|Caching, .htaccess and adsense question|
| 10:14 pm on Jan 4, 2012 (gmt 0)|
I am working on code for my .htaccess file to cache and speed up my site.
The code I am talking about is:
Header set Cache-Control "max-age=600, private"
3) Should it be "private" or "public"
3) Is there anything that would pose a risk about this, or does it matter (regarding adsense)
In sum: What is best practice?
Just trying to be extra safe. Any feedback would be extremely appreciated. Thank you!
| 10:31 pm on Jan 4, 2012 (gmt 0)|
You don't host the AdSense js code so your cache has no control over this.
Google hosts the AdSense js, and in theory once the browser has loaded AdSense from Google it should have it in the browser cache itself for all subsequent loads from any website.
| 10:58 pm on Jan 4, 2012 (gmt 0)|
Thanks incrediBill. Does the same apply with compressing and gzip-ing with the .htaccess? I had read someone claim that because text compressing can remove comments that this could potentially modify adsense code, which is against TOS. Probably just being over-careful, but I just want to make sure I don't screw anything up. Thanks for your reply.
| 11:14 pm on Jan 4, 2012 (gmt 0)|
Sounds like you're listening to old AdSense wives tales, ignore those myths.
Compression doesn't remove comments, it only compresses them during transmission and they are decompressed on the receiving side. Google uses gzip themselves so I wouldn't be too worried about it.
| 11:19 pm on Jan 4, 2012 (gmt 0)|
you are right - there is a lot of crap out there that is mis-information and sometimes it's hard to know what's what - but I do always want to be super careful, which is why I asked.
You've been super helpful - thank you for your help!
| 3:12 am on Jan 5, 2012 (gmt 0)|
Ah, just remembered there are 'text compressing' programs out there too that reformat the actual HTML code on the page, totally different from gzip compression. The reformatting text compressors actually remove white space and comments from web pages to make them a few hundred bytes smaller, complete waste of time IMO, but those could potentially violate TOS by actually modifying AdSense code.
Those types of page reformatting routines I would avoid.
However, reformatting to save a few bytes isn't gzip. Gzip is a lossless data compression algorithm where data comes out the other end looking just like it did when it started, no changes.
| 1:46 am on Jan 10, 2012 (gmt 0)|
Thank you for posting your 'aha!' - that is really helpful to me. Since speed is such an issue now, it's good to look at all of the options out there.