Replies: 2 comments 9 replies
|
I think it is well described in here, isn't it? https://nextjs.org/docs/api-reference/next/image#caching-behavior
Basically, the server that gives next.js the image, has to set a Cache-Control header, next.js honours that value. Alternatively, you can use the |
|
is there a way to flush the whole image cache? |
Uh oh!
There was an error while loading. Please reload this page.
By default, optimised images (if using the
next/imagecomponent for example) are cached in the /_next/images folder. By default this cache is NOT flushed when you trigger a new deploy. Which is good, a project with probably thousands of images that are cached this way, you don't want to be optimising images on every build.It does bring another problem though. I can't really get this from the documentation, but how long are those images cached? I've got an image that has changed on the source (different image, same url) but the cache remains the same.
Is it possible to clear the image cache (preferably for just one image)? Or any other way to instruct dat the image should be processed again?
All reactions