Make Browsers Cache Static Files With mod_expires On Apache2 (Debian Squeeze) This tutorial explains how you can configure Apache2 to set the Exp. Enable it with “a2enmod expires” if you’re using Ubuntu or Debian – afterwards restart Apache): mod_expires.c> ExpiresActive on. It might be as simple as missing one keyword that is causing your issue. ## EXPIRES CACHING ## mod_expires.c> ExpiresActive On ExpiresByType.

Author: Shakagor Samugar
Country: Suriname
Language: English (Spanish)
Genre: Education
Published (Last): 1 August 2006
Pages: 115
PDF File Size: 5.81 Mb
ePub File Size: 12.40 Mb
ISBN: 745-3-86867-468-9
Downloads: 57637
Price: Free* [*Free Regsitration Required]
Uploader: Goltilmaran

php – Leverage browser caching, how on apache or .htaccess? – Stack Overflow

In this case, it really won’t make that much of a difference. The most expirwsbytype guide I’ve met after a long research on the subject. Stack Overflow works best with JavaScript enabled. Exxpiresbytype again, JF Reply. I have a problem like that in CakePHP but this is not a solution for all files: On a Debian based system e. To remove the cache from your browser, your browser cache needs to be cleared.

Enabling the expire module also wont work till the expire time set by the Heuristic expiration policies expires. If there isn’t already an. What is the exact issue and suggestion GTMetrix is giving you an “F” for? Hello Arun, Apologies, but I’m not seeing the errors you’re referring to.


I’ve head it can be something wrong in my httpd. It does appear that you may have some server side caching issues that you may want to speak with your server admin about.

In that code, you wxpiresbytype see that the cache expiration time is set as 1 year for some file types and 1 month for others. More explanation o these settings will come later in this article. I’m not sure how you have your WordPress installation is configured caching, etc. Then i modifed the file again today then accessed for 2nd time but it didnt show me the modified content because expireshytype serves the file from cache.

After that whatever i access how many time expiresbytpe accessed eventough modifying the file, it will always shows the old file from cache. How do I set these to have long expiration? Also, it is possible that you’re running into files on servers where the expiry header aren’t supported.

Using Apache mod_expires to control browser caching

I haven’t found any tutorial though so that’s why I’m asking you where and how can I setup expire headers for css, png, jpg, Sign up or log in Sign up using Google.

This makes your site faster to surf on the web. To specify the specific times for each individual file type, you will want to use the previous code example. Post Your Answer Discard By clicking “Post Your Answer”, you acknowledge that you have read our updated terms of serviceprivacy policy and cookie policyand that your continued use of the website is subject to these policies.


Are you sure you want to replace the current answer with this one? If you have any further questions, feel free to post them below. The following will explain the Directive types that are used for Cache-Control. There are 6 static components without a far-future expiration date. So we cannot go by the 2nd testing result like creating a new fileWe have to make this work for old files also.

Please let me know your thoughts. These HTTP headers are an instruction to the client about the document’s validity and persistence. I last modifed a file name sample.

Kindest Regards, Scott M. Also note that if you use a far future Expires header you have to change the component’s filename whenever the component changes. No script or program we are using.

iPhone X