Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should dryRun skip reading from cache? #33

Closed
Zegnat opened this issue Aug 11, 2023 · 1 comment
Closed

Should dryRun skip reading from cache? #33

Zegnat opened this issue Aug 11, 2023 · 1 comment

Comments

@Zegnat
Copy link
Contributor

Zegnat commented Aug 11, 2023

This caught me off guard. I was using dryRun to test some requests, and at some point I noticed that they were coming back with answers suspiciously quick. Turned out I had run the request without dryRun at some point and therefor a cached item had become available.

I am not sure what is the more expected behaviour here. When someone sets dryRun to true to disable writing new caches, should it still read old caches anyway?

I do think the effect of dryRun can be made a little more clear in the documentation regardless. I might file a PR for that later, just wanted to get a discussion started here.

@zachleat zachleat added this to the Eleventy Fetch v4.0.0 milestone May 13, 2024
@zachleat zachleat removed this from the Eleventy Fetch v4.0.0 milestone May 13, 2024
@zachleat
Copy link
Member

dryRun does allow reads from cache, important for running in serverless bundles allowing folks to pre-warm the cache. See #28 (shipped with v4.0.0). You can opt-out of this by setting a cache duration of 0. Happy to review a PR to improve the docs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants