#netlify plugin cache

5 messages · Page 1 of 1 (latest)

kind snow
#

Hello good people,
I have installed netlify-plugin-cache on a project to test it out, and wondering what's your go-to configuration for Astro?
Do you typically cache "dist/_astro"?

Here's what I think I will use

[[plugins]]
  package = "netlify-plugin-cache"
  [plugins.inputs]
   paths = [
     ".astro",
     "node_modules/.astro",
     "node_modules/.cache"
   ]

Thank you 🙂

kind snow
#

Bump!

hearty fractal
#

👋 The Netlify build system should already cache the best paths without any configuration.

It looks like this netlify-plugin-cache is some third-party (unmaintained!) plugin you happened to land on. It could be useful for special cases, but isn't needed for all the main package managers, frameworks, build systems, and monorepo tools.

kind snow
# hearty fractal 👋 The Netlify build system should already cache the best paths without any conf...

Hi @hearty fractal,
Thanks for your input.
Yes, I did noticed that an older project, not using Netlify Plugin Cache, but hosted on Netlify, seems to be automatically using cached content for images

Here's an excerpt from the build log:

9:59:55 AM:  generating optimized images 
9:59:55 AM: 08:59:55   â–¶ /_astro/vdm.CesbJkdT_67glH.webp (reused cache entry) (+2ms) (1/2108)
9:59:55 AM: 08:59:55   â–¶ /_astro/hero.1jRcZtHs_Z10VqFg.avif (reused cache entry) (+2ms) (2/2108)
9:59:55 AM: 08:59:55   â–¶ /_astro/anais.B_olmalK_Z1eraBa.webp (reused cache entry) (+2ms) (3/2108)

THis particular project does use the Netlify adapter. Does it play a role in the caching, you think?

hearty fractal
#

Are you asking about @astrojs/netlify Is that what you mean by 'Netlify adapter'?

In any case, no, I don't believe it does.