0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-13 22:11:20 -05:00
astro/.changeset/seven-shrimps-hope.md
Tony Sullivan b5e25afa94
Update seven-shrimps-hope.md (#4934)
Upgrading the image caching feature as a minor release
2022-09-30 16:38:21 +00:00

701 B

@astrojs/image
minor

Adds caching support for transformed images 🎉

Local images will be cached for 1 year and invalidated when the original image file is changed.

Remote images will be cached based on the fetch() response's cache headers, similar to how a CDN would manage the cache.

cacheDir

By default, transformed images will be cached to ./node_modules/.astro/image. This can be configured in the integration's config options.

export default defineConfig({
	integrations: [image({
    // may be useful if your hosting provider allows caching between CI builds
    cacheDir: "./.cache/image"
  })]
});

Caching can also be disabled by using cacheDir: false.