Jon, Tilmann,
I agree with you both. Yes, caching should really be part of the
request processor. Especially since I made a small but crucial mistake
in the above code. The cache-control filter should be registered as a
postauth filter rather than a trace filter. A trace
filter isn't executed till after the connection closes.
I hadn't noriced because ACS developer support had me fooled for a
while as the cache control headers did show up in the request
information of ACS developer support. Delorie has a cool HTTP Header Viewer
to inspect headers of Internet accessible sites with.
There is a lot more to controlling caching than this simple script
handles. Postauth filters for example, are run before the request
processor and hence it is impossible to use [ad_conn]
to
find out if the request was for a static file or not. Robert pointed
out some of the other short comings.
Which ever solution will be adopted I belief that it should be part
of the request processor where it can better distinguish between
content material (dynamic, static, image, content type, etc) and the
appropriate action. The final solution should leave room for
customization, e.g. cache some parts of a site longer than others.
/Bart