draco icon indicating copy to clipboard operation
draco copied to clipboard

Gstatic, CDNs, and per-domain caching policy

Open donmccurdy opened this issue 1 year ago • 1 comments

The repository contains a number of references to this idea:

It is recommended to always pull your Draco JavaScript and WASM decoders from this URL. Users will benefit from having the Draco decoder in cache as more sites start using the static URL.

While this was accurate when it was written, it isn't how browser caches have worked since about 2021. See:

https://www.stefanjudis.com/notes/say-goodbye-to-resource-caching-across-sites-and-domains/

Starting with v86, Chrome will be using combined cache keys, too... If your sites request the global jQuery, modules from unpkg.com, font files from Google fonts or GA's (Google Analytics) analytics.js, users will redownload the resources no matter if they downloaded and cached them for other sites already.

That being the case, it would be really nice if Draco were available from the npm package registry where web developers usually find dependencies. The Draco builds currently published there work only in Node.js, but the registry is designed to handle dependencies for web, Node.js, and other JavaScript runtimes. I think @bhouston's suggestions on this topic in https://github.com/google/draco/issues/977 are excellent, and I'd be very glad to help make that happen.

donmccurdy avatar Feb 02 '24 17:02 donmccurdy

I could sponsor #977 with an open source bounty of $500 USD if that helps.

bhouston avatar Feb 08 '24 05:02 bhouston