TWiki uses alot of static files, and util we implement the magic js and css minify we've been talking about for a while, you can reduce the load on your apache server, and increase the aparent speed of your user's experience, by setting the Expires HTTP header for static files to 'quite large'.
Because TWiki.org has an obvious cyclic usage profile TWiki view mrtg graph, and because we're likely to upgrade the server to 4.2.0 in the comming months, I've settled on = ExpiresDefault "access plus 11 days"=.
you may need to turn on the mod_expires module in your apache's httpd.conf, but the rest of the settings can be put into the .htaccess file in the pub directory.
#this prevents clients from re-requesting at all, freeing up apache to serve what what we need
#LoadModule expires_module libexec/httpd/mod_expires.so
#AddModule mod_expires.c
<ifmodule mod_expires.c>
<filesmatch "\.(jpg|gif|png|css|js)$">
ExpiresActive on
ExpiresDefault "access plus 11 days"
</filesmatch>
</ifmodule>
#add ETags.
FileETag MTime Size
What these settings mean, is that browsers that have requested and received static files, in this case images, css and javascript any time in the last 11 days, will not even ask the server if those files have changed. thus often reducing the number of requests for a view to just the html output from TWiki.
If you want to see th other things you can do - see YSlow for Firebug and extension for Firefox that is almost compulsory for developing, or administrating web servers
other links:
(Not sure if 11 days is a good idea for .js files - could be a long time to wait to pick up changes in an AJAX file, but a good idea for images and CSS I think.
BTW the blog comment plugin on this page is broken at least for me - generated a page containing only my comment, though I now realise that's probably the idea - it's just rather different to most other blog comment setups. Also on hitting the back button I got something like ViewAfterSaveCachesOldPage, which at least is an on-topic bug but was also confusing. Also, I can't see how to edit a blog comment after posting.) - RD
Comments
RichardDonkin - 29 Sep 2007:
Good idea to go for the static content first! There are some links about cache control headers at BrowserAndProxyCacheControl, though that was mostly thinking about TWiki's dynamic content.