Niklas Edmundsson wrote:
Different VHosts meaning different URLs/directories, pointing to the same files...
Hmm... Two thoughts come into my head over this one.One way to approach this is to treat this as a general problem of how do we stop people who download the same file from multiple places (say different mirrors via proxy, or different URLs to the backend like you have) from downloading multiple copies of the same file hosted at different URLs.
Here you might have some kind of regex-like expression, like *.iso, that says "all files whose names match this regex, are considered the same file". A mechanism might have a small cache of filenames that have matched the regex in the past, and that link to actual cached entries in the cache.
This would need to be abstracted out into an existing hook (or new one if necessary).
A second approach could involve the use of the Etags associated with file responses, which in the case of files served off disk (as I understand it) are generated based on inode number and various other uniquely file specific information.
Therefore in theory two responses with the same Etag are actually the same file, and if you've already cached a file with that Etag, then the same Etag quick cache scenario described above could provide a shortcut to the same file cached at a different URL.
Regards, Graham --
smime.p7s
Description: S/MIME Cryptographic Signature
