Solution: use protocol-relative URLs now
http://autoref.com/blog/2012/09/13/the-tech-behind-autoref-p...
HN user
Solution: use protocol-relative URLs now
http://autoref.com/blog/2012/09/13/the-tech-behind-autoref-p...
This isn't recommended since many browsers and proxies do not cache resources that are referenced using a query string, even if a cache-control or expires header is set appropriately. Google says Squid up to 3.0 will not do so:
https://developers.google.com/speed/docs/best-practices/cach...
The bad part is no file is cached between pushes, right?
An excellent point, but you have to consider warm cache vs cold cache optimizations. For a cold cache, it's better to combine assets and reduce HTTP requests. We do that on our homepage.
For a warm cache, it's better to split assets up so they are cached in finer chunks. If I added jQuery in to every page JS, there would be few HTTP requests but it would pull jQuery every time, making the payload much larger. There's a balance. I'll write another post about warm vs cold cache optimizations soon.
"using the same CSS/JS products across multiple pages would help."
Definitely. Using jQuery on half your site and YUI on the other half is pretty bad from all angles.
"you could load jquery from the Google AJAX API endpoint."
Yeah. Two reasons we don't: 1. I'm in security, and trust no one. 2. HTTPS connection reuse vs negotiation with another host. I have yet another post in the pipe about SSL optimizations.
Right. Images and fonts have to be written and hashed first, then used in the template rendering of the CSS file. The CSS references the assets with hashes in the filenames.