I am working on a caching server that will cache only documents (PDF, MS Word, Powerpoint, Excel) that will be fetched over HTTP.
I am aware of the various HTTP headers available for cache invalidation, but am wondering if I can do something smart in case the required headers are missing. Note: in my case I know the type of document being fetched.
Is it possible that I can do some selective byte range requests and based on the result decide if my cache should be invalidated or not. For e.g. for PDFs, if for a given file, the content length matches, the first 'n'K bytes and last 'm' K bytes match, the PDF file has most likely not changed because of how the PDF writers work.
Is something like this possible for MS Office documents? If yes, is there any project already doing this? If not, some general guidelines on how can I go about doing it?