Follow

browser extension idea:

local javascript/css cache using the subresource integrity data on the script and link tags

· · Web · 1 · 0 · 0

developer.mozilla.org/en-US/do

Assuming all CDNs and first-party servers serve the exact same file for each version of each library (aka no CDN-specific modifications, or user-specific tracking), and assuming SRI attributes exist on the elements loading the files, the extension would only need to download the file once to use it across every site requesting it.

Show thread

This might also be a good addition to LocalCDN/Decentraleyes and similar extensions that hardcode CDN urls manually.

The only problem is not everyone cares about the subresource integrity stuff, so the effect of this wouldn't be noticeable

Show thread

@admi Am in a place with sick bandwidth but awful computer so this seems backwards to me. But I get that my experience isn’t universal

@Sandra

What is the exact problem you're worried about?

If it's disk usage, your browser will generally cache assets for some time anyway, and in cases where this approach would be effective those filed would probably be duplicated anyway (different servers serving the same file)

If it's speed, your browser will already check the integrity of the file using the same exact checksum anyway, and the extension would only need to check once when downloading, as the browser would (probably) verify it each time it's used assuming the way you inject the local asset isn't bypassing the native integrity check.

Considering the background wget I'm running is at it's 4th try with speeds as low as 10-20 KB/s, I'd expect the more agressive caching to have plenty of uses.

@admi Running too many extensions generally tends to mess things up

Sign in to participate in the conversation
unnecessary posts 2: the electric toot-aloo

Personal server. Totally overkill but ok.