API for clearing/removing cached images #237
-
The current Cleaning up cached images might be required for legal purposes (takedowns, privacy violations, etc.) or simply for reducing storage costs. I would suggest adding a
The LRU cache should then obviously retry generating the image, instead of throwing an exception when the cached file can't be found anymore. Any thoughts on this before shipping v2 (as this will be a breaking change). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The problem with a clear option is that it’s potentially expensive and should be non-blocking. That’s why clearing was always left as an implementation detail of whatever site is using the middleware. I don’t think a reasonable implementation can be added. If someone wants a clearable cache I would suggest they implement the cache interface and use their own logic |
Beta Was this translation helpful? Give feedback.
The problem with a clear option is that it’s potentially expensive and should be non-blocking. That’s why clearing was always left as an implementation detail of whatever site is using the middleware. I don’t think a reasonable implementation can be added.
If someone wants a clearable cache I would suggest they implement the cache interface and use their own logic