3 ms·
Wouldn't you just use a CDN that your visitor's browser would pull a cached copy from if you were worried about large assets? They're only downloaded once*, mig
by drusepth 10y ago
Wouldn't you just use a CDN that your visitor's browser would pull a cached copy from if you were worried about large assets? They're only downloaded once*, might as well re-use the one downloaded the last time you visited a site with React. Or do I not understand how browser caching works?
- jacobr 10y agoThis is nice in theory, but... A user visits site A. To get a cached version of React the following need to be true: 1. A user has to have visited a site, site B, with React recently. 2. The site with React needs to be using a publicly available CDN. 3. Site A and Site B must use the same CDN. 4. The versions of React must match exactly. There are already about a dozen alpha/patch/rc versions of the React 15.x.x series alone. In practice, this does not happen very often: https://www.stevesouders.com/blog/2013/03/18/http-archive-jquery/ https://www.stevesouders.com/blog/2013/03/18/http-archive-jq...