This is my first cut a cache-optimisation. Feel free to comment on enhancements.
deflate here is simple. Compress if the server has that module and the client claims to support it.
Etags, Expire and Cache-Control are specified in RFC2616 and provide hints as to when the client need not request the same URL again. Etags allows the client to submit 'request if changed' GET request.
Cache-Control public allows the content to be cached even on a SSL connection by the client. This hasn't got security implications as the static images are public anyway. Cache-Control public also permits proxies to share the caching between a number of users.
Top level .htaccess file
Code: Select all
ETag MTime
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>
<IfModule mod_headers.c>
# replace 'append' with 'merge' for Apache version 2.2.9 and later
Header append Cache-Control public env=!NO_CACHE
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
</IfModule>
668K before and 271K after. Seems my hosting provider is doing etags by default hence the untuned case looks good. I haven't worked out why the primed cache is larger in the second case.