11ty / eleventy-fetch

Utility to cache any remote asset: Image, Video, Web Font, CSS, JSON, etc
https://www.11ty.dev/docs/plugins/fetch/
144 stars 17 forks source link

Reusing build time cache with serverless #28

Closed ryangittings closed 1 year ago

ryangittings commented 1 year ago

I’m following the docs here:

https://www.11ty.dev/docs/plugins/serverless/#re-use-build-time-cache-from-the-fetch-plugin

So, here's a test case to describe my issue. Here are two URLs:

/build/ /serverless/

Hit the serverless endpoint, and with every hit you'll see the log that it's fetching:

[11ty/eleventy-fetch] Fetching: https://dummyjson.com/products/1

https://github.com/ryangittings/11ty-serverless-fetch-issue

I’d expect the build cache to be reused and the URL not to be hit.

zachleat commented 1 year ago

Huh. Well, this is definitely a bug!

Using dryRun actually prevented both file reads and writes, when clearly we want to allow reads.

This will ship with Eleventy Fetch 4.0.0

ryangittings commented 1 year ago

Awesomesauce! Can I use a patch or a specific branch in npm in the meantime?

zachleat commented 1 year ago

This will ship in the next hour or two just going through the rest of the backlog on this repo first

zachleat commented 1 year ago

(it’s on github now)

zachleat commented 1 year ago

4.0 has shipped!