jdriscoll/django-imagekit — Issue #107: Cache-Backed Image Cache Backend
Author: matthewwithanm
Created: 2012-02-18 06:22:02+00:00
State: open
Labels: Contribute!, Feature Request

The `PessimisticImageCacheBackend` is super safe, but also potentially very slow. The `NonValidatingImageCacheBackend` is very fast, but if an image goes missing from storage, you could have an issue. I'd like a backend that balances the concerns a little better: a subclass of `PessimisticImageCacheBackend` that stores the state in [the cache][0].

I'm not sure what we should name it, but the implementation shouldn't be too difficult. Just store the state (valid/invalid) in the cache and update it when `invalidate()` is called—and in `is_invalid()` if the value in the cache has expired.

[0]: https://docs.djangoproject.com/en/dev/topics/cache/