Support Center » Knowledgebase » Unix Tips » Using Expires Module in Apache

Using Expires Module in Apache

To allow the browser to more effectively cache images that have been downloaded, the Apache Expires module allows you to set the document / object expiration to a far distant future.  This will improve user's browsing experience as more objects will be cached locally. They will especially benefit from this as they move from page to page and try to load common objects such as common javascripts, css, and/or images from your site. 

Here is one example of how to use it from within your .htaccess file:

<IfModule expires_module>
ExpiresActive On
ExpiresByType image/png "now plus 1 week"
ExpiresByType image/jpeg "now plus 1
ExpiresByType image/gif "now plus 1 week"
ExpiresByType application/javascript "now plus 1 week"
ExpiresByType application/x-javascript "now plus 1 week"
ExpiresByType text/javascript "now plus 1 week"
ExpiresByType text/css "now plus 1 week"

Article Details
Article ID: 188
Created On: 29 Aug 2012 09:55 AM
 Login [Lost Password] 
Remember Me:
Please note that the login and password to the support area is NOT the same as your hosting control panel login and password
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | Downloads | Control Panel User's Guide | Server Status