I have a drupal site running on AWS. 4 months back I followed the guildelines in this forum for increasing page speed and caching and every thing went fine. Now i can see the leverage browser caching is in RED
I have a linux server with mod_expires on - pagespeed disabled, etags disabled.
I have added the following in my .htaccess
# Enable expirations.
ExpiresActive On
# Default directive
ExpiresDefault “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 year”
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/css “access plus 1 month”
ExpiresByType application/javascript “access plus 1 year”
ExpiresActive Off
Even after doing all these why the caching is not working? Can any one help me on this?
# Enable expirations.
ExpiresActive On
# Default directive
ExpiresDefault “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 year”
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/css “access plus 1 month”
ExpiresByType application/javascript “access plus 1 year”
<FilesMatch .php$>
# Do not allow PHP scripts to be cached unless they explicitly send cache
# headers themselves. Otherwise all scripts would have to overwrite the
# headers set by mod_expires if they want another caching behavior. This may
# fail if an error occurs early in the bootstrap process, and it may cause
# problems if a non-Drupal PHP file is installed in a subdirectory.
ExpiresActive Off
Any chance you have a test result? Just want to check the file names and mime types. Are there any rewrite rules that would rewrite images to go through php?
And as a sanity check, you’re positive that mod_expires is still installed and enabled?
The files themselves look like they have mime types and paths that should trigger the rule. Only things that jump out at me as possibilities:
mod_expires isn’t really active. What happens if you eliminate the IfModule check? You should start getting 500’s for page content if it isn’t enabled and it should have no impact if it is
.htaccess overrides are disabled
There is another .htaccess somewhere more specific in the path overriding the setting
There is a rewrite rule that routes all of the static files through a php handler for some reason
Could You please let me know why You feel that the mod expire is not enabled?
thank you
Sathish
[hr]
Helllo
I got one more .htaccess inside a demo folder. I will removed it after taking a backup.
Regarding the mod_expire - when i give the comman a2enmod expires - I am getting this message -“Module expires already enabled”