respondcreate / django-versatileimagefield

A drop-in replacement for django's ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.
http://django-versatileimagefield.readthedocs.io/
MIT License
531 stars 88 forks source link

How to tell if an image has been pre-warmed? #145

Open bunnyfly opened 5 years ago

bunnyfly commented 5 years ago

Is there any way to tell if an image has been pre-warmed yet?

I want to warm images asynchronously in a worker process, but this means thumbnail URLs I'd send back in my API requests will be 404s for a bit. In the meantime, I'd like to just send the original image so clients have something to display, but how can I tell whether to return the original image or warmed URLs?

If needed, I could make a field "is_image_warmed" to go along with every versatile image field I have and manually update that myself. But I'd rather not do that if there's an already available way.

Thanks!