3 ms·
The image is only downloaded once, but each page you load re-requests it. If your account has enough karma to downvote posts, you're requesting two array gifs
by getsat 14y ago
The image is only downloaded once, but each page you load re-requests it. If your account has enough karma to downvote posts, you're requesting two array gifs per page view.
There's no Expires header being set, so your browser is not caching these images. A full roundtrip to the HN server to get back the "content hasn't changed" status code (304) is required for each.
- masklinn 14y ago> The image is only downloaded once, but each page you load re-requests it. No, it most definitely does not does not. > There's no Expires header being set, so your browser is not caching these images. You're out of your mind, of course the browser caches it, the browser caches everything it can by default: http://i.imgur.com/hrmIs.png http://i.imgur.com/hrmIs.png > A full roundtrip to the HN server to get back the "content hasn't changed" status code (304) is required for each. That is not even remotely close to what happens in the actual reality we're part of.
- ars 14y ago> There's no Expires header being set, so your browser is not caching these images. That is not in the slightest correct. It has both a Last-Modified and an Etag so it's definitely cached. > A full roundtrip to the HN server to get back the "content hasn't changed" status code (304) is required for each. Also incorrect. The roundtrip is done once per session. A session is not well defined, but it's basically till you close the browser or till you click reload. Merely clicking on other stories will not trigger another roundtrip. (Also pressing enter on the url line will not trigger a roundtrip, but reload will. This is important sometimes.)
- masklinn 14y ago> It has both a Last-Modified and an Etag so it's definitely cached. Even without that, it'd still be cached: pretty much all browsers will cache things by default. Last-Modified and Etag only come into play when the internal cache expires (this expiration time can be configured with the HTTP/1.0 Expires header or the HTTP/1.1 Cache-Control: max-age attribute, but the timeout does not default to "don't cache anything").
- humaknlght 14y agoIf you are really worried about performance (and the operators of of this forum should be) then there are more important things that need to be fixed besides just adding caching headers to an images (which is still a good idea). https://developers.google.com/speed/pagespeed/insights#url=http_3A_2F_2Fnews.ycombinator.com_2Fitem_3Fid_3D4238575&mobile=false https://developers.google.com/speed/pagespeed/insights#url=h...