Hi folks, I couldn't find any posts about this issue-
I am using Firebug to examine my page loading. When I call a large JS file, it gets downloaded once and then shows as being cached the next time I go to the page.
For example, it shows "9 requests 100 KB (90 KB from cache)"
However, if I change the JS file to a PHP file with GZIP, it compresses that 90KB file down to 20KB, but never says it pulls it from cache. The Firefox "about:cach e" page shows that each time the page loads, the fetch count on that file goes up.
I am wondering- is this gzipped file being repeatedly downloaded, or just checking that the file is still the same? If it is being downloaded again, is there a different header I can send to make it work?
Here is the PHP I am using for the gzipped javascript (see to expire 1 year)
[PHP]
ob_start("ob_gz handler");
header("Content-type: text/javascript; charset: UTF-8");
header("Content-Encoding: gzip");
header("Cache-Control: must-revalidate");
header("Expires : ".gmdate("D ,d M Y H:i:s",time() + 3600*24*365)." GMT");
[/PHP]
Thanks everyone!
I am using Firebug to examine my page loading. When I call a large JS file, it gets downloaded once and then shows as being cached the next time I go to the page.
For example, it shows "9 requests 100 KB (90 KB from cache)"
However, if I change the JS file to a PHP file with GZIP, it compresses that 90KB file down to 20KB, but never says it pulls it from cache. The Firefox "about:cach e" page shows that each time the page loads, the fetch count on that file goes up.
I am wondering- is this gzipped file being repeatedly downloaded, or just checking that the file is still the same? If it is being downloaded again, is there a different header I can send to make it work?
Here is the PHP I am using for the gzipped javascript (see to expire 1 year)
[PHP]
ob_start("ob_gz handler");
header("Content-type: text/javascript; charset: UTF-8");
header("Content-Encoding: gzip");
header("Cache-Control: must-revalidate");
header("Expires : ".gmdate("D ,d M Y H:i:s",time() + 3600*24*365)." GMT");
[/PHP]
Thanks everyone!
Comment