kotx / render

Cloudflare Worker to proxy and cache requests to R2
MIT License
384 stars 85 forks source link

Cache hit ignored for 304 response #17

Closed Zeblote closed 2 years ago

Zeblote commented 2 years ago

Hi, just noticed that you are checking for response.ok() to see if cache was hit. This will fail if cache returned a 304 response to a correct etag.

kotx commented 2 years ago

Hey, this should be a simple fix but I'm off for a few days- feel free to implement this yourself if you feel the need, I'll be happy to merge it.

kotx commented 2 years ago

Fixed, but only for 304 responses. LMK if you need some other status code.