When running a test on google pagespeed insights I get the error "Leverage browser caching"
What I have done
Confirm that modules are enabled and working in Apache.
As you can see here: http://noram.dk/phpinfo.php both
mod_expires
andmod_headers
are installed and enabled. Also when i writesudo a2enmod expires
andsudo a2enmod headers
I get a "module already enabled" (And I did restart Apache2)Double confirm that modules are enabled and working in Apache.
To double check this I have also tried removing the
<ifModule mod_expires.c>
and<ifModule mod_headers.c>
lines from my .htaccess file (and the end tags ofc.), to confirm that I can still load the page without getting a server. I have also confirmed that my .htaccess file is working, by writing some junk in it, which does kill my website. (i also have working RewriteRule's in it)
So to summarize
- I am pretty sure the modules are installed and running.
- The htaccess file is working and being read by the server.
- I have inserted the code in the htaccess file as I should.
However, I keep getting the same feedback from google PageSpeed insights.
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType text/css "access plus 2592000 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
</ifModule>