Closed theaquarium closed 4 years ago
Whats the reason for someone not wanting image caching? just figuring out if adding a optional config is useful or not :)
@JoeGandy Honestly, I can't think of one. The ETag handles if they change the file, or delete it.
I guess it's just better have to more configuration than less. Having an option won't hurt, but it should be on by default.
The only thing I thought could be a problem is if someone renames an image and then uploads something with a new name before their cache's TTL expires. The cache's TTL is currently set to 15 minutes, so the ETag won't do anything until 15 minutes after accessing the file, which could cause problems in certain situations. I think it's useful to just have a bunch of configuration options people can use if they need to.
I'll just leave the option since I think it's always good to have configuration.
Resolves #100
This implements caching for images and includes validation using image hashes and the ETag header.
Thanks to @davwheat for the code.