4 ms·
This is even more so if your site is served over HTTPS given the latency for the initial SSL handshake[1]. Even better not to load anything and have it properly
by sehrope 13y ago
This is even more so if your site is served over HTTPS given the latency for the initial SSL handshake[1]. Even better not to load anything and have it properly cached on the client side.
If you do it right you don't even have the client send/receive an HTTP 304. For our app we have a lot of modular dependencies but we serve all of them from a unique prefix per build (eg. 'assets-SHA(build)/js/foo.js'). The second page load and beyond has zero requests for the same static asset. Whenever we have a new build of the app the unique prefix gets auto updated to force clients to use the latest versions.
For HTTPS make sure to mark your assets as public or they won't be cached:
Cache-Control:max-age=31557600, public
[1]: http://www.semicomplete.com/blog/geekery/ssl-latency.html http://www.semicomplete.com/blog/geekery/ssl-latency.html