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. Required fields are marked *

Most Popular Posts

How to use Ajax in WordPress

Posted on 4 years ago

Bhumi

How BlockChain and Ethereum works?

Posted on 3 months ago

Bhumi

Introduction to PDO in PHP

Posted on 2 years ago

Bhumi

What are Traits in PHP

Posted on 2 years ago

Bhumi

Overview of ECMAScript 6 new Features

Updated 18 years ago

Bhumi

Getting started with Amazon Web Services

Updated 18 years ago

Bhumi

Facade implementation in Laravel

Updated 18 years ago

Bhumi

The Reader’s Poll – June 2015

Posted on 2 years ago

Bhumi

The Reader’s Poll – August 2014

Posted on 3 years ago

Bhumi

The Reader’s Poll – June 2014

Posted on 3 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 3 years ago

Bhumi

The Readers’ Poll – August 2013

Posted on 4 years ago

Bhumi