Tuesday, April 20, 2010

TutZone- Tutorials, Design news and Inspiration

TutZone- Tutorials, Design news and Inspiration

Link to TutZone

Force Caching With .htaccess Method To Increase Loading Speed Of Your Site

Posted: 20 Apr 2010 08:45 AM PDT


This hack will not increase the loading speed of your website directly. But instead, this will load the content of your site much faster when same user (returning visitor) visits your site again by sending 304 status for the components which have not been modified. Currently the cache expiry is set to one day, but you can change it accordingly by modifying the number of seconds, i.e. 86400 in our case.

This simple tutorial will help you achieve this in a snap.

Technique:

Note: Do take backup of your .htaccess(hypertext access) file.

01. Search for a file named .htaccess(hypertext access) in the webroot of your server (FTP) and can be easily edited using any text editor (like Notepad). Open it and add below code in it:

FileETag MTime Size
ExpiresActive on
ExpiresDefault “access plus 86400 seconds”

02. Save and you are done.

This concludes this simple and useful tutorial. Hope you like it.

No comments:

Post a Comment