in reply to Re^4: Slightly OT: Stop caching images
in thread Slightly OT: Stop caching images
You can chain handlers in Apache (eg: the second content-handler gets the output of the first content-handler). In this vain, you could have a mod_perl handler after the standard handler, which computes/fetches the ETag for the resource.
If you need fine-grained control of caching, you'll probably want to use mod_perl anyway.
An ETag is simply a unique resource identifier. The simplest scheme I can think of is to compute an MD5 digest of the file (say as hex), sending that as the ETag. That way, only if the file contents change, the browser will know if it must really refresh the file.
-David.