imageproxy icon indicating copy to clipboard operation
imageproxy copied to clipboard

Double caching?

Open Fieldistor opened this issue 5 years ago • 1 comments

When there is no any option (r.Options.String() = 0x0) it leads to double caching (no fragment cached image ({remote_url}) and fragment cached image ({remote_url}#options). Ofc, I can fix it just by adding extra check `r.Options.String() == "0x0", but I have some questions:

  1. why it works like that?
  2. is there any problem to disable caching for 0x0 version of image?

Fieldistor avatar Apr 01 '20 23:04 Fieldistor

interesting... I'm not sure why I've never paid attention to that before. You're definitely right that it's double caching the unmodified image, and we should fix that. I don't think it will be quite as simple as checking for "0x0", since depending on where you do that check, you miss out on things like checking for whether a 304 response should be returned.

I'll certainly leave this open to fix when I get a chance. Looking at the TransformingTransport also reveals some wasteful reading of the response when no transformation is going to take place, so some of this code may be do for a larger refactor.

willnorris avatar Apr 03 '20 04:04 willnorris