Vercel Remote Image Cache Deletion

In our NextJS site, we use an external CMS to handle our data. We have recently removed an image from the CMS as a result of a copyright issue. However, due to Vercel Image CDN caching this image is still available through the cache and the _next/image api.

For example, we have image example.png. We deleted example.png from our CMS, and it is no longer used on our site, but if you go to oursite.com/_next/image?url=cms.com/example.png. Then the image is still available.

This image does not exist in our CMS so we do not have access to the URL, nor do we use the URL directly in the codebase. I know based on these docs that re-deploying the site will not clear the image cache. In additon, I have changed the minimumCacheTTL. I am not sure what else to do in order to remove this image from the Vercel Image cache.

It is extremely important the image(s) get deleted as we are getting issues with copyright infringement even though these images are not used on our site.

Hi, and welcome to the community, @tonytrill!

However, due to Vercel Image CDN caching this image is still available through the cache and the _next/image api.

Could you try purging the data cache? Below are related documentation on how to do this:

Hey @pawlean , I have tried purging the data cache as well as re-deploying. Based on the documentation, none of these methods will remove the remote image from the Vercel Image CDN.

We even tried adding a middleware.js to our NextJS server. In this case we redirected the user to a 404 page if they tried to make a request to image. This worked locally but when deployed to production on Vercel did not work because the request does not even make it to the server to pass through the middleware. The Image CDN just presents the cached image and no request is made.

We aren’t really sure what do here. Is it possible for me to send Vercel the image links and have you guys invalidate manually? It really is important these images get removed as they are copyrighted.

@pawlean Is there anything that can be done to remove these images from the Vercel Image CDN? Thanks!

Hi, @tonytrill!

I understand, I’m not sure of the answer but just asked internally and will circle back. :smile: Thanks for your patience!

@tonytrill You can invalidate the image by adding a query parameter as like ?v=2 in order to consider this as a “new” image optimization requests. I’ve linked a section in our docs for more information.

Let us know if you have any more questions!

Hey @pawlean, how do you recommend doing this trick if we no longer have access to the image? The image has been deleted from our CMS, and is no longer used anywhere on our site.

Following up on this as this is a serious issue our organization is facing. Is it possible to elevate this issue?

Hi, @tonytrill!

Thank you for your patience.

You can wait up to 30 days and it will get deleted automatically by our caches, or do a manual delete. However, you’ll have to disclose image URLs to us.

@pawlean I can share the links with you privately. Is there a way to do that?

I’ll send you a private message. :smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.