Is it possible to discover, via JavaScript and without any additional HTTP requests, whether or not a particular feature is in the browser cache? And if it is, get it also without this requisition?
In my understanding, when the server submits a "long-running" feature (ie a header Expires
with a very high value) browser checks - in a second query - if this resource exists in its own cache and its validity has not yet expired, that no further requests are made. However, if such a resource is not found or is "outdated", the request is made immediately - without giving the programmer the chance to cancel it.
I'd like to have a little more control over this process: If the feature is in the cache, use it, otherwise adopt an alternate strategy. For this it would take a sort of JavaScript API to query the state of the cache, I believe, and as far as I know this is not possible - since the browser abstracts its programmer cache.
Is there something - preferably cross-browsers - that meets this requirement? Or maybe an alternative way to get the same result?
Note: I'm not interested in solutions involving local storage - this would require taking the resources already in the cache and saving (and managing) a copy of them in that already limited space.