Friday, April 22, 2011

htaccess file to run the two compression scripts and cache images for wordpress

Add entries to your Website .htaccess file to run the two compression scripts and cache images

Add the following to the end of the .htaccess file (usually at the root of your Website). If a file named .htaccess doesn’t exist then create a file named .htaccess in a text editor, add the text below and then transfer to the root of your Site.

# BEGIN Compression and Caching Script per http://wordpresspartner.com

# This calls the ‘compress-css.php’ and ‘compress-js.php’ files


RewriteEngine on
RewriteRule ^(.*\.(css))$ compress-css.php?file=$1
RewriteRule ^(.*\.(js))$ compress-js.php?file=$1


# This enables caching


Header set Cache-Control “max-age=2592000, public”


Header set Cache-Control “max-age=216000, public, must-revalidate”


Header set Cache-Control “max-age=1, private, must-revalidate”



# End Compression Script

The method as described above has been tested with WordPress Sites hosted by Godaddy

No comments:

Post a Comment