
Ask HN: A Git-like diff server for web assets - nlusskin
This idea popped into my head and I wanted to get the HN community&#x27;s opinion:<p>Would serving diffs of static assets on the web improve loading speed and reduce server load?<p>Instead of serving an entirely new file to be downloaded every time changes are made, compile diffs for the last 10 or so releases and then serve them based on a visitors&#x27; current version, supplied as a release code in request url. Then, make the changes and cache the new file(s).<p>Does this exist? If not, why?
======
tedmiston
It's not quite what you described but static asset fingerprinting or asset
digest fingerprinting is a good place to start.

In theory, if you're using this behind a cache or CDN, then you've already
heavily optimized your server load for serving static assets.

I haven't seen any sort of a diff-based approach to caching in the browser. I
don't think there is a notion of cache "layers" for an arbitrary binary file
in a browser to easily support this, but that doesn't mean you couldn't build
it. Maybe you could use localStorage / sessionStorage here?

Another research term that might be useful is incremental caching.

This seems relatively new but cache digests could also be useful here.

[https://calendar.perfplanet.com/2016/cache-digests-
http2-ser...](https://calendar.perfplanet.com/2016/cache-digests-http2-server-
push/)

