Forum Moderators: phranque
It's not a matter of making Apache log cached content requests, it's a matter of getting the client browser to access your server even when re-loading previously-cached content, which it won't usually do. If the browser accesses your server, then your server can log the access. If not, it can't.
You can use Apache mod_headers [httpd.apache.org] to send a cache-control header to the client browser with each of your multimedia files. If you specify "no-cache, must-revalidate", then browser reloads of these cached files will result in a 304-Not Modified entry in your log file.
Be aware that "no-cache" doesn't mean "Don't cache this file" - It means "This object may be held in any cache but it must be revalidated every time it is requested." And "must-revalidate" is needed to tell most caches to take you seriously when you tell them "no-cache".
The following Apache code sets the cache-control header for any file which has a name starting with "ads" and ending with ".avi". This is specified using the regular-expressions [etext.lib.virginia.edu] pattern in the <FilesMatch> container. This code may be used in .htaccess or in httpd.conf.
I use Header unset and Header append, rather that Header set, because I once ran into a quirky system where Header set didn't work. You can try using Header set if you like.
<FilesMatch "^ads.*\.avi$">
Header unset Cache-Control:
Header append Cache-Control: "no-cache, must-revalidate"
</FilesMatch>
>> browser reloads of these cached files will result in a 304-Not Modified entry in your log file.
That's all I can tell you. It works for me. There's a very slight possibility that some broken proxy caches on the network or some very old or primitive browsers might not do what you want. There's also the possibility that I misunderstood your needs, and that what you want to do is impossible, but I suggest that you try it.
The biggest problem I expect you will have is that if you have not been sending any cache-control or expires headers in the past, then you'll have to wait for those old cached files to expire in the users' caches before they will come fetch a new copy that includes your new headers. Normally, this will happen after a few days anyway. If you need 'instant results', then rename the files or put them into a new subdirectory and change your links to them. This will make their browser think they're something new, and force it to go to your server.
Jim