enable leverage browser caching
|
09-04-2012, 11:43 PM
Post: #1
|
|||
|
|||
enable leverage browser caching
Hello
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 <IfModule mod_expires.c> # 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 </FilesMatch> </IfModule> Even after doing all these why the caching is not working? Can any one help me on this? thanks! Sathish |
|||
09-05-2012, 12:11 AM
Post: #2
|
|||
|
|||
RE: enable leverage browser caching
What's the </FilesMatch> directive? I don't see a matching open on it.
|
|||
09-05-2012, 12:22 AM
Post: #3
|
|||
|
|||
RE: enable leverage browser caching
hi
i missed the full code in .htaccess - its here <IfModule mod_expires.c> # 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 </FilesMatch> </IfModule> thank you |
|||
09-05-2012, 12:28 AM
Post: #4
|
|||
|
|||
RE: enable leverage browser caching
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? |
|||
09-05-2012, 12:31 AM
Post: #5
|
|||
|
|||
RE: enable leverage browser caching
Hi
thank you for the quick reply. ![]() Yes the mod_expires is enabled - i am seing this when i type the command 'dir /etc/apache2/mods-enabled' in the Shell - alias.conf autoindex.conf env.load php5.load alias.load autoindex.load expires.load reqtimeout.conf auth_basic.load cache.load headers.load reqtimeout.load authn_file.load cgi.load mime.conf rewrite.load authz_default.load deflate.conf mime.load setenvif.conf authz_groupfile.load deflate.load negotiation.conf setenvif.load authz_host.load dir.conf negotiation.load status.conf authz_user.load dir.load php5.conf status.load Please find the link for the test results here http://www.webpagetest.org/result/120904_EZ_BZH/ thanks! Sathish |
|||
09-05-2012, 01:16 AM
Post: #6
|
|||
|
|||
RE: enable leverage browser caching
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 |
|||
09-05-2012, 02:28 AM
Post: #7
|
|||
|
|||
RE: enable leverage browser caching
Hello
I will check if there is any other .htaccess file exists or not Do i need to paste the full htaccess file details here? thank you Sathish |
|||
09-05-2012, 11:57 PM
Post: #8
|
|||
|
|||
RE: enable leverage browser caching
No, I'd say just check for other files and try removing the module check as an extra check to make sure it's actually active.
|
|||
09-07-2012, 01:54 PM
(This post was last modified: 09-07-2012 02:30 PM by sbcs.)
Post: #9
|
|||
|
|||
RE: enable leverage browser caching
hi
I will check for any additional .htaccess files Could You please let me know why You feel that the mod expire is not enabled? thank you Sathish 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" I will update You thank you |
|||
09-08-2012, 09:20 PM
Post: #10
|
|||
|
|||
RE: enable leverage browser caching
Hi
Its all the same ![]() |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)