2 ms·
> it's just that now you're redownloading it every time your browser updates There's no reason browsers couldn't have a persistent cache for this. Think of it
by krapp 5y ago
> it's just that now you're redownloading it every time your browser updates
There's no reason browsers couldn't have a persistent cache for this. Think of it more as an integrated dependency manager and VM that just happens to use web infrastructure. No one would blink at downloading 20MB of dependencies anywhere else, after all.
- klodolph 5y agoBrowsers already have a persistent cache! If you're downloading it on-demand and caching it, why would it need to be integrated in the browser at all? Why not just stick it in a CDN and treat it like a regular file, the way it works right now?
- krapp 5y ago> Browsers already have a persistent cache! And yet whenever this comes up, someone always insists that you'd have to re-download the entire runtime with every request, as if caching wasn't a thing. As far as shipping vs caching goes, I see no reason not to do both. Maybe ship with the latest version of a few popular languages including javascript already pre-cached and allow for downloading others as required. I don't know what would be more optimal. Maybe when you download a browser, you can select language support options. My point is, this is just an implementation detail, it doesn't have to be awkward or inefficient.
- jchw 5y agoCaching is partitioned by origin for privacy reasons; caching still helps, but a public CDN solution doesn’t improve things any. That does open an argument for having a kind of global interpreter cache, though it could still be used for fingerprinting.
- bastawhiz 5y agoDifferent origins don't share a cache anymore. A Google Font on one origin doesn't benefit from it being cached after it's used on another origin. The browser handling this as a special feature by default avoids cache isolation issues. It also makes it trivial to avoid leaning on even more third parties (CDNs, package managers) to run your code: as long as your browser is supported, code won't stop working in it.