-
Notifications
You must be signed in to change notification settings - Fork 30
Cached images only downloading last byte #17
Comments
I've been noticing some image errors as well. I hadn't looked into it yet because it was just development, hadn't moved anything to production yet. |
@mholt what was the original request? I have disabled (bypass) requests with Edit: looking at the code I was a little confused: |
Yeah, that response header is also why I'm confused. I haven't seen it before I enabled the cache plugin (simply added |
I could reproduce the issue using curl sending a request with I have released a new version of the plugin which completely disables the cache when there is a partial response or the request has a |
Fascinating; that must have happened just seconds after I restarted the server (this is very unlikely though, the site is extremely low traffic), because I went to try it literally just seconds after starting the server up. I'll try the new version and let you know! |
@nicolasazrak The update seems to resolve the issue for me. Thanks! Still baffled, and frankly not convinced, that a request came in with such a range header, though. On that note, does the cache consider request headers at all? (Since they can drastically change the content that gets served.) I know that response headers should dictate what to cache but I wonder what parts of the request are used to map requests to cache elements. |
@mholt The cache only considers headers that the response specifies in vary header. Thinking about it in depth, I must also consider conditional headers like |
Oh boy... I dunno tbh. Trial and error? Maybe looking at how nginx or varnish do it? (I don't have links for ya right now either, sorry...) |
I'm trying out the cache plugin on my personal site and am seeing some images being downloaded with a Content-Length of 1, for example: https://matt.life/resources/images/lake.jpg
This is downloaded with a content of
Ü
and a content-range header of just the last byte. You can see the rest of them like this on https://matt.life.The text was updated successfully, but these errors were encountered: