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, assume 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 headers are working.