Firefox@lemmy.world: Caching frequently downloaded / used page assets?
I read the descriptions for the Dcentraleyes and LocalCDN addons which cache popular JS frameworks and page assets to enhance privacy and speed up pages that use them (since the assets were downloaded beforehand). Does Firefox have any built-in functionality to cache frequently used assets, or are there any addons that do so?
For instance, If I access Reddit.com a lot, I would want all the resources that all those Reddit pages have in common to be cached automatically to make loading pages from the domain faster.
I made an extension called "Cache Longer" which forces static assets to be cached for 6 months, regardless of what the website wants. If any website starts looking janky or stops working, just do a hard refresh (very rarely needed).
This was last updated 3 years ago, does it still work fine? Maybe add a note saying that it works as of 2024? I also see an issue opened a year ago that's unanswered.
Hit about:cache in your URL bar and you can see what it's caching.
Firefox has a memory cache, that lasts for the life of the browser session, and a disk cache that persists from session to session.
Note that by default, if you have Firefox set to delete data in your browser on exit (which is a sensible thing to do from a privacy standpoint), it'll also wipe the browser cache (which is sensible behavior, since you can be identified by what your browser has cached in the past, same way cookies work). So if you have that privacy setting on, you may have no persistent cache.
The browser disk cache size used to be exposed in the GUI preferences. At some point, IIRC, they switched to a "smart cache size" based on available disk space which is IMHO excessively conservative. You can bump it up in about:config today with the browser.cache.disk.capacity setting today, and probably have to flip off browser.cache.disk.smart_size_enabled.
Yeah, regular http cache is indeed a thing. However it's more complicated because the web server can tell the browser how the returned content should be cached - if at all. So if, say, reddit servers ask the browser to not cache particular resource (for whatever reason) then it won't be cached. I mean, the browser is free to do as it pleases, but I think in general browsers would do as the server asked and indeed not cache it.