4 ms·
All CSS and Images are inline - that reduces the number of requests which need to be made to the server. They are so small, web browsers spend longer c
by shurcooL 10y ago
All CSS and Images are inline - that reduces the number of requests which need
to be made to the server.
They are so small, web browsers spend longer connecting to the server than the
time taken to download them. So I placed them inline to the HTML - that saved
a heap of downloading and rendering time.
I'm curious how it would compare to an alternative solution that does not inline anything, but instead relies on HTTP/2 and/or HTTP/2 server push [1]. Go recently added support for the latter in Go 1.8 [2].
[1] https://en.wikipedia.org/wiki/HTTP/2_Server_Push https://en.wikipedia.org/wiki/HTTP/2_Server_Push
[2] https://golang.org/doc/go1.8#h2push https://golang.org/doc/go1.8#h2push
- chrischen 10y agoI'd imagine it'd be faster since multiple cores can be used for requests. Before http/2 multiple static asset domains were used to allow for parallel downloads.
- iainmerrick 10y agoYou are downloading the same amount of stuff either way.