Back to Top

How to set Expire Headers using .htaccess?

To set Expire Headers using .htaccess

Every Browsers store/save static data like images, Javascripts and CSS files and cache data which is used to speed up the rendering page. So, Browser cache static data, we have to set expire date of cached data to reload again.

So, Today I am going to explain how to set expire date til that browser will keep data using .htaccess.To set the expire header via htaccess you have to enable mod_expire module of the apache.

Always Use a future date to set expiry Date using htaccess.Here, I have used the example from HTML5 Boilerplateache to expire the header of the static content.

Make sure that you do not use files that changes frequently as whatever file used and set as expires header those files are cached in the browser until it expires.

Copy the provided code and paste into your htaccess file.That’s it

Suggested Read:

Table layout using DIV tags
The DocType In HTML

Hope this article helpful to you.As always, thanks for reading. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

The Readers’ Poll – August 2012

Posted on 11 years ago

Bhumi

How to Animate SVG Image with example

Posted on 8 years ago

Bhumi

The Reader’s Poll – August 2014

Posted on 9 years ago

Bhumi