Closed danlsgiga closed 1 year ago
Hi @danlsgiga! After reading your issue I wonder, does this PR make caching work for 30x responses or does it completely disable catching on those?
hi @fgilio, yeah... basically, 3xx responses are redirection only and what was happening is that I was getting 302's from the upstream but the cache was responding with a 200 and the http redirection never happened since the browser only reads the new Location:
header if the response is 301 or 302.
Also, I'm sorry for the failing tests... I started using the memory backend but soon I started to get huge memory usages, probably memory leaking too, and moved to the file backend and made a few adjustments there too.
hi @fgilio, yeah... basically, 3xx responses are redirection only and what was happening is that I was getting 302's from the upstream but the cache was responding with a 200 and the http redirection never happened since the browser only reads the new
Location:
header if the response is 301 or 302.
Hi @danlsgiga ,
Thanks for your work. I've fixed this bug in another pull request so this pr need to be updated.
@sillygod any chances we can get the other features I added merged?
- Changes how the file backend store the files by using sha256 hashes based on the entry keyWithRespectVary() content. This way, we don't waste storage space by creating duplicated temporary files every time the caddy process is restarted.
- Implemented the Length() function for the file backend, since some browsers have grief when the Content-Length is set to 0 and abort the operation causing the http request to have an empty body
@sillygod any chances we can get the other features I added merged?
- Changes how the file backend store the files by using sha256 hashes based on the entry keyWithRespectVary() content. This way, we don't waste storage space by creating duplicated temporary files every time the caddy process is restarted. - Implemented the Length() function for the file backend, since some browsers have grief when the Content-Length is set to 0 and abort the operation causing the http request to have an empty body
Sorry for replying so late, I'll check it today.
Furthermore, would you please fix the failed test? I've seen that the file backend's schema is changed so the relevant tests should be revised.
Close #33
defaultCacheKeyTemplate
to exact matches on resources that are redirected.