5 ms·
1/ Because you cant cache static resources on a CDN without javascript ? 2/ Because you cant load light html over the wire ? 3/ Because you cant cache html pag
by camus 13y ago
1/ Because you cant cache static resources on a CDN without javascript ?
2/ Because you cant load light html over the wire ?
3/ Because you cant cache html pages client side ?
- EGreg 13y agoAre you serious? 1. The browser requests CDN resources directly and Javascript is used to combine those static files into something that the user sees. Since the code is executing on the client, the app server is not overloaded. 2. Suppose you have a list of 20 items. You could either output HTML with all the tags already rendered for each of the 20 items, or you could output a JSON array with 20 objects, which is much less on the wire. 3. If you are rendering stuff on the client and only fetching data for it (which is what modern Javascript MVC frameworks let you do) then you can cache that data and re-use it. Caching entire HTML pages is at a much lower level of granularity that caching each piece of data you get from the server, and reassembling it in different ways.
- sergiosgc 13y ago1. Use a CDN that supports ESI, like CloudFront. 2. It's not that much of a difference, after gzipping, which you surely already do. 3. See number 1. Moreover, in the end, you'll get a less heavy document to be processed by the browser. I swear my all bells and whistles i7 X1 Carbon still struggles on some javascript-heavy sites.
- EGreg 13y agoPlease do elaborate on 1 :)
- steveklabnik 13y agohttp://en.wikipedia.org/wiki/Edge_Side_Includes http://en.wikipedia.org/wiki/Edge_Side_Includes