#Image loader
1 messages · Page 1 of 1 (latest)
Hi @unique dawn. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
No, using a custom image loader does not remove the use of the cache in the <Image> component. The image loader is primarily responsible for generating the URL of the image, while caching behavior is handled separately.
According to the Next.js Image Component documentation, a custom loader is a function that returns a URL string for the image, given parameters like src, width, and quality. It doesn't directly affect caching.
The caching behavior for images is determined by other factors, such as:
-
For local images, the cache key is based on query string parameters, the
AcceptHTTP header, and the content hash of the image URL, as mentioned in the Vercel Image Optimization documentation. -
The
minimumCacheTTLconfiguration innext.config.jscan be used to set a minimum cache duration for optimized images, as described in the Next.js Image Component documentation. -
The
Cache-Controlheader of the upstream image also plays a role in determining the expiration of the optimized image.