Wednesday, April 21, 2010

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

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.

Read more: tut zone

Posted via email from jasper22's posterous