Hello, I'm researching how to best integrate caching with a mod_perl website. For some important cases I want to do some customized stat tracking for particular queries, although they otherwise return the same content, which would otherwise be directly cacheable.
The approach that seems to fit this well is the following, based on research (but not yet practice!): 1. Include a "Last-Modified" header as often as possible. As I understand, this doesn't mean "cache me and don't come back", but is an invitation to simply re-validate later. 2. Look for "If-Modified-Since" headers in incoming responses, meaning that the client has stored a copy. When this kind of Conditional GET comes in, I can still run the tracking code unconditionally. However, I could return a 304 if the cache was up to date, or return the standard content otherwise. Is that a reasonable sounding approaching for the want-caching-but-need-stats case? Or I should be working on adjusting my thinking to deal with less accurate stats so improve caching performance. Thanks! Mark