next.js
39eb8e0a - feat(next/image): add lru disk cache and `images.maximumDiskCacheSize` (#89963)

Commit
28 days ago
feat(next/image): add lru disk cache and `images.maximumDiskCacheSize` (#89963) This PR adds an LRU disk cache so that reads and writes from the Image Optimization API will evict old entries based on the value of `images.maximumDiskCacheSize` configuration. The LRU ensures that cache reads bump the entry to the top so that they don't get evicted - only the least recently used entries get evicted. When `next start` is run, if there is an existing disk cache the we will replay the files in order to populate the LRU and respect `images.maximumDiskCacheSize` if it was changed. If no configuration is provided, default to 50% available disk space.
Author
Parents
Loading