News for hackers. Stuff that matters.
Re:Why we don’t use a CDN: A story about SPDY and SSL (2014) by michaelmior on Thursday April 02, 2015 @09:35AM (#9310563)
Very often people concatenate and minify different assets, which is another reason that this sharing doesn't occur much in practice.
Re:Why we don’t use a CDN: A story about SPDY and SSL (2014) by riskable on Thursday April 02, 2015 @12:43PM (#9311801)
...which creates another problem with optimization: As soon as you make a change--no matter how small--to a single one of those concatenated assets you now have to deliver the entire new combined asset to the client. If you make changes to your JS/CSS assets on a regular basis (rapid iteration anyone?) this means your clients might be best served via individual assets (depending on your traffic patterns).

I have solved this problem myself by avoiding concatenation and using the browser's IndexedDB to store assets that can be loaded dynamically (JS, CSS, and client-side templates). Assets like this get downloaded over a WebSocket connection which provides the same advantage of SPDY in that no re-negotiation is necessary.

You can see the implementation of this here:

https://github.com/liftoff/GateOne/blob/master/gateone/core/...

...and the client side code is here:

https://github.com/liftoff/GateOne/blob/master/gateone/stati...

(Including the functions immediately following that one)