Possible FAQ or even feature relating to browser cache
Hey there, and thanks for your awesome work on this extension.
I presented it tonight (https://twitter.com/martinkrafft/status/1031838014262063104 for context), and a question was brought up why we don't just use the browser cache. I think it's worth exploring this, because it might be worth a FAQ entry for your project. On the other hand, maybe Decentraleyes could actually grow a new feature?
It's my understanding that even though my browser has cached a file, such as jquery-1.91.js, whenever the cache is hit, there'll still be an HTTP request to the originating source, to validate that nothing has changed. I may well be wrong, not claiming to have understood how caching works.
While Decentraleyes has a number of pre-defined resources it basically injects into intercepted requests, and even a mode to disallow requests it cannot field, wouldn't it be possible to extend it to "learn" additional, static resources, and serve them up while preventing the HTTP requests?
Basically, if I download a file foobar.js
from cdn.example.org
, then could we maybe use some heuristic to determine if we deem this resource to be immutable, such as "there is a version number in the path", or "it has a well-defined name", which would cause Decentraleyes to "adopt" the resource? Such that further requests to that resource will be intercepted, with Decentraleyes causing the browser to serve the cached content directly, without asking the server first for the timestamp of last modification?
I hope I am making sense. If not, please tell me and I'll attempt to clarify.