[wp-hackers] Javascript Caching

Michael D Adams mikea at turbonet.com
Wed Jun 7 19:32:42 GMT 2006


It seems that WordPress' PHP based javascript (list-manipulation- 
js.php, cat-js.php, etc.) do not get cached by my browser [1].  I  
have confirmed this by tailing my server's logs and by watching the  
transactions with LiveHTTPHeaders [2].

Does anyone else see similar behavior?

Perhaps we should add to these files something like the following.

header('Cache-control: max-age=2600000, must-revalidate', true);  //  
~1 month
header('ETag: ' . $_GET['ver'], true);

My knowledge of HTTP headers and browser/proxy caching is poor, however.

Michael

[1] Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: 
1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
[2] http://livehttpheaders.mozdev.org/


More information about the wp-hackers mailing list