Activating mod_expire not working as expected
I am trying to turn on my expire headers. I'm running a CENTOS 6.10 kvm with whm v70.0.62.
In easy appache 4 i installed the mod_expire 2.4.37-1.1.2.cpanel.
Then in my .htaccess I put this script:
# Optimize cache-control
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType text/html "access plus 3 days"
ExpiresByType text/xml "access plus 1 seconds"
ExpiresByType text/plain "access plus 1 seconds"
ExpiresByType application/xml "access plus 1 seconds"
ExpiresByType application/rss+xml "access plus 1 seconds"
ExpiresByType application/json "access plus 1 seconds"
ExpiresByType text/css "access plus 1 week"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType image/x-ico "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresByType application/pdf "access plus 1 month"
Header unset ETag
Header unset Pragma
Header unset Last-Modified
Header append Cache-Control "public, no-transform, must-revalidate"
Header set Last-modified "Wed, 23 Jan 2019 1:10:10 GMT"
However when I do a site test on pingdom or gmetrix it's still saying I don't have expireheaders active and so both are downgrading me.
-
Did you tried restarting apache by stopping and then starting ? Also why you are still on 70 version ? latest is v76.0.18 . Can you please try upgrading the Cpanel to latest version as well. 0 -
Did you tried restarting apache by stopping and then starting ? Also why you are still on 70 version ? latest is v76.0.18 . Can you please try upgrading the Cpanel to latest version as well.
Thanks for the help! Restarting apache did it. I can't believe I didn't try that first. As for version. I have my system on LTS updates. I guess I thought it was safer, think its better to move it to general availability releases?0 -
I'm really happy to see you were able to get your issue resolved @rudtek!! Thanks for following up and letting everyone know how it was resolved. I guess I thought it was safer, think its better to move it to general availability releases?
You're fine to be on LTS - there are sometimes when you will get fixes first on the RELEASE tier but they are backported in most cases to LTS0 -
Glad that you are able to get it fixed by apache restart. I will always suggest to keep almost all softwares to the latest possible versions as that is one way to keep hackers away. 0
Please sign in to leave a comment.
Comments
4 comments