Search code examples
djangodjango-imagekit

How to clear imagekit cache


I'm using imagekit on S3 with a NonValidatingImageCacheBackend backend. I recently changed the sizes on one of my specs and realized that imagekit didn't regenerate new specs because the optimistic backend is blinding retrieving the old cached images.

How can I force imagekit to regenerate the entire cache?


Solution

  • I figured it out (after reading this): Say you have a ImageSpec called thumbnail, then simply call the generate method on that object. It'll regenerate the thumbnail file for you.