Hi friends,
Overview: I live across the world from the discuss.tchncs.de server and have noticed when I “fresh load” (or browser reload, but not a shift-reload force) the banner image on the home page sidebar always re-downloading (it’s noticeable, takes 1-2 seconds). Once on the site, clicking “tchncs” top left to go back to the homepage does not trigger the re-download, fyi.
…tchncs.de/…/7285a9e0-5492-4461-8188-6778d7d594c7…
- The image is only ~500kb (depending if you get the JPG or webp) and it 100% has proper cache-control headers being sent. It’s in 1920x1080 size and always gets down-sized into a smaller size to fit on the sidebar. There is nothing wrong with the server headers in the response.
- Using the webdev console, I found is that Firefox does not seem to send If-modified-since headers in the request so the server has to always return a 200 instead of a 304 (use cached version). So it’s probably cached in my browser, by the browser isn’t sending the right type of request to trigger use of the cache on my side. Not sure if Lemmy code bug or Firefox bug not sending if-modified-since headers, not a webdev. :)
Suggestion: Since this image appears to only be used to always downscale on the browser side to fit in the sidebar (? I think?), we could probably pre-downscale it on the server side to half or 1/4 of it’s fileize. This would reduce network bandwidth for the server side and increase responsiveness on fresh load for users.
Thanks for reading.
straycatstrut@discuss.tchncs.de 6 days ago
Here’s the basic set of response headers showing the server is sending the proper cache-control directives on the image. The problem appears to be on the Firefox side using them properly.
straycatstrut@discuss.tchncs.de 6 days ago
Firefox webdev console request headers (minus my personal cookie), where I’m already on the page and just click the refresh button. No
if-modified-sincesent to the server to trigger a proper 304 response:Stefan_S_from_H@discuss.tchncs.de 6 days ago
It could be that Firefox doesn’t cache files if the URL has a query parameter.