Comment

Peter Bengtsson

Mind you, if you have the time and tools, the ideal thing is to have EVERYTHING. I.e. HTTP/2 *and* CDN. This site, for example, is entirely behind a CDN; the HTML, the .css files, the images, and even the endpoints that will never be cached like posting a comment.
But it requires quite a bit of work to get cache invalidation right. For images (or compiled .js and .css files) that's never a problem because you make sure the filename is always unique and then you can cache it "forever". For dynamic content however, you need to have the tools to be able to invalidate CDN cached stuff.

But I still stand by the fact that if your dynamic site (e.g. Django or Drupal) is working with HTTP/2 there's little point in inserting things like `<link rel=stylesheet href="https://mycdn.example.com/static/foo.a82eef5f.css"> in the HTML because it would hurt more than it helps. Sorta.

Regarding cookie-less domains, that's not very important. Just make it so that the relevant URLs can be cached independent of cookies. Otherwise, a CDN (or a regular web server) won't be able to reuse a URL for you and for me.

Parent comment

b0br

Great post. Totally relevant as I'm setting up an assets server for static content. I found it very interesting and has me thinking about the way forward for me. I see that the cost involved in negotiation for additional urls, even https is not great compared with the cost of serving from the same domain. I would ask though, what about cookies? I have been under the impression that static content should be served from a cookies-less domain. That being said I will continue to think before further implementation. Thank you! >> @z0mb1ebob