anush Posted February 17, 2012 Posted February 17, 2012 Can any what is meant by Leverage browser caching and Specify a Vary: Accept-Encoding header. how can it me implemented with php sorry when i tried to post this some internal error occurred that is why there is 2 post.if any admin can remove it please remove it i have closed that one. Quote
viclou Posted February 18, 2012 Posted February 18, 2012 It can be implemented by the .htaccess file... but I'm not sure with PHP.Here are 2 examples: ## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType text/css "access 1 month" ExpiresByType application/pdf "access 1 month" ExpiresByType text/x-javascript "access 1 month" ExpiresByType application/x-shockwave-flash "access 1 month" ExpiresByType image/x-icon "access 1 year" ExpiresDefault "access 2 days" </IfModule> ## EXPIRES CACHING ## and # Set Cache-Control and Expires headers <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$"> Header set Cache-Control "max-age=2592000, private" Header set Expires "Sun, 17 July 2011 20:00:00 GMT" </filesMatch> <filesMatch "\\.(css|css.gz)$"> Header set Cache-Control "max-age=604800, private" </filesMatch> <filesMatch "\\.(js|js.gz)$"> Header set Cache-Control "max-age=604800, private" </filesMatch> <filesMatch "\\.(xml|txt)$"> Header set Cache-Control "max-age=216000, private, must-revalidate" </filesMatch> <filesMatch "\\.(html|htm)$"> Header set Cache-Control "max-age=7200, private, must-revalidate" </filesMatch> Quote
anush Posted February 18, 2012 Author Posted February 18, 2012 Thank you for your help but after i added you code to my .htaccess , my performance grade increased by just 2 and still the pingdom tools Recommend me to Leverage browser caching and set Accept-Encoding header. Quote
viclou Posted February 19, 2012 Posted February 19, 2012 set Accept-Encoding header means you have to set the encoding on each file you have... but I'm not sure how to do that! But yes, you're welcome! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.