feat(images): use experimental `isrFlushToDisk` option to prevent writing optimized images to cache (#70645)
#### Description
This PR implements the use of the existing experimental configuration
option, isrFlushToDisk, for Next.js, which prevents optimized images
from being written to the cache directory. This feature can be useful in
scenarios where disk writes need to be avoided, such as in environments
with limited disk space or read-only file systems.
By enabling this option, the `x-nextjs-cache` response header will
always return `MISS` for every request, indicating that no caching is
taking place for optimized images.
#### Configuration Example
To disable the cache, add the following to your `next.config.js`:
```js
module.exports = {
experimental: {
isrFlushToDisk: false,
},
}
```
- Fixes #25846
---------
Co-authored-by: Steven <steven@ceriously.com>