Forum OpenACS Q&A: Re: Strange cross-caching of users

Posted by Bart Teeuwisse on

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.


Posted by Jeff Davis on
Some issues I see: .css$ etc will also match "xcss" and you should say switch -regexp -- $url since urls starting with "-" will break the filter. It ignores whether the headers have been set already which means if you have a .vuh handler or dynamically generated images etc which might do something like vuhhandler/21987/foo.css you won't have any way to disable it.