Reputation: 7435
I've been trying to get this to work for hours now. The browser is downloading the file every time even though the Expires
header is set to a week from now. Also tried on Firefox, same result. How can I specify that this resource is still valid and there's no need to download it every time?
Here is the Chrome network log
Here is the Chrome headers for the javascript file.
Here is my .htaccess code. I have confirmed that mod_expire is enabled.
ExpiresActive On
<FilesMatch "\.(css|js|gif|png|jpg|jpeg)$">
ExpiresDefault "access plus 1 week"
Header append Cache-Control "public"
</FilesMatch>
Upvotes: 2
Views: 1062
Reputation: 6759
Change httpd.conf
<IfModule mod_expires.c>
<FilesMatch "\.(jpe?g|png|gif|js|css)$">
ExpiresActive On
ExpiresDefault "access plus 1 year"
</FilesMatch>
</IfModule>
Set cache to 2 years
Header set Cache-Control "max-age=63072000, public"
Upvotes: 1