After adding expires headers, you may found they are not working as expected. According to your server’s settings, there are a few situations that cause this issue.
In below checking process, assuming you are using Apache server.
Checking flow of expires headers not working
- Check whether
.htaccessis disabled in
httpd.confof your apache (generally
httpd.confis located in the
Check whether the
AllowOverrideoption is set to
None. If it is, then
.htaccessis disabled. You can add the configuration for adding expires headers in the main configuration file
mod_expiresis loaded in your
There will be a line like below if
mod_expiresis loaded in httpd.conf. If it is commented out or missed, fix it.
LoadModule expires_module modules/mod_expires.so
Remember to restart apache. Then you should find that the expires heading are working.