On Wed, Nov 26, 2003 at 11:40:19AM +0000, Jean-Michel Hiver wrote: > Hi List, > > At the moment my application runs as a mix of mod_perl handlers and a > rather large-ish Apache::Registry CGI program. > > Initially the application was generating everything on the fly. Due to > performance issues, I started writing a little cache manager so that > most pages are cached, such as: > > http://mkdoc.com/ > http://mkdoc.com/news/newsletters/ > > However certain dynamic pages remain uncached, such as: > > http://mkdoc.com/.sitemap.html > http://mkdoc.com/.print.html > > What I need is a generic apache handler which would cache any HEAD and > GET methods for a configurable amount of time, and let the POST methods > through. > > It would also need to be partly purgeable. For example, if an editor > goes to /foo/.properties.html and changes the title of /foo/, then /foo/ > needs to be purged from the cache. > > Is there an Apache handler I can use for this purpose? > > If not, which approach would you take in order to write one? I've > contemplated the idea but I'm stuck with capturing Apache::Registry or > Apache::RegistryNG's output.
If you're willing to enter the wild-n-wooly world of object-oriented mod_perl handlers you might consider trying Apache::CacheContent (available on CPAN), which is based on Cookbook::CacheContent in the mod_perl Developer's Cookbook. It dumps the request onto a file on disk based on the URL. If the file is removed then the content is regenerated. The module does not cache headers, instead it uses Apache's built-in file-serving code to serve up cached content written to disk. Give it a try... OO handlers are quite fun. -- Paul Lindner [EMAIL PROTECTED] ||||| | | | | | | | | | mod_perl Developer's Cookbook http://www.modperlcookbook.org/ Human Rights Declaration http://www.unhchr.ch/udhr/ -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html