iftechfoundation / ifcomp

The software behind the Interactive Fiction Competition.
Other
23 stars 12 forks source link

Images should respond 304 Not Modified on refresh #161

Open dfabulich opened 5 years ago

dfabulich commented 5 years ago

Here's the URL for the 2018 IFComp winner's box art. https://ifcomp.org/static/images/covers/yspn49v69hzc8rtb

View it in Google Chrome's Network tab. Uncheck "Disable Cache." You'll see that the image has a Last-Modified response header. Refresh the image. The request has an If-Modified-Since header.

Expected: The server should respond with a blank 304 Not Modified response. Actual: The server responds 200 OK and redownloads the entire image.

dfabulich commented 5 years ago

This is similar to (but different from) issue #101. That issue would allow browsers to cache the image for longer, without attempting to revalidate the image cache. Fixing this issue would allow the server to return a fast response when the cache is revalidated (e.g. on refresh).

jmacdotorg commented 5 years ago

Let images use HTTP 304

curiousdannii commented 3 years ago

This is needed for the ballot page too. Every time you view it it's 25MB over the wire. Tagging as bug because this really is faulty behaviour.

Can I suggest that some tests also be added to check whether each type of image resource served by the site has appropriate headers for caching?