Jump to content

Recommended Posts

Posted

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.

Posted

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>

Posted

post-24476-0-60310300-1329542241_thumb.jpg

 

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.

Posted

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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...