Skip to content

Speed up your WordPress blog download times

These two steps took 42% off the download size of this blog's front page.

[Update 2009-06-17]

Problems with caching php output. Comments did not appear for some users. New .htaccess settings:

# MOD_DEFLATE COMPRESSION
SetOutputFilter DEFLATE

# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0

# Set up caching on media files for 1 year (forever?)
<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|gif|jpg|jpeg|png)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</FilesMatch>

# Set up caching on media files for 2 months
<FilesMatch "\.(swf)$">
ExpiresDefault A4838400
Header append Cache-Control "public"
</FilesMatch>

# Set up 2 month caching on commonly updated files
<FilesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A4838400
Header append Cache-Control "proxy-revalidate"
</FilesMatch>

# Force no caching for dynamic files
<FilesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-tran                                          sform"
Header set Pragma "no-cache"
</FilesMatch>

# PUT YOUR WP SUPER CACHE RULES HERE

# KILL THEM ETAGS
FileETag none