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

Assorted Cache API fixes #433

Merged
merged 5 commits into from
Nov 18, 2022
Merged

Assorted Cache API fixes #433

merged 5 commits into from
Nov 18, 2022

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Nov 17, 2022

Each of these fixes is split into a separate commit for easier reviewing. 🙂

  • Enable persistence: previously the cachePersist option was being ignored, so cached data couldn't be persisted
  • Disable Workers Sites asset caching: we always want to serve the latest on-disk Workers Sites files so changes are reflected. However, @cloudlfare/kv-asset-handler automatically caches files, so we need to disable the Cache API for these URIs.
  • Allow cache to be disabled: Miniflare 2 had a cache: false option for disabling the cache. The Cache API was still available, it just didn't do anything.
  • Facilitate cache usage warning on workers.dev subdomains: Cache API operations are no-ops on workers.dev subdomains. This is a common cause of confusion, so this PR also brings over Miniflare 2's cacheWarnUsage: true option. We can set this in Wrangler if we detect the user will be publishing to a workers.dev zone.

@changeset-bot
Copy link

changeset-bot bot commented Nov 17, 2022

⚠️ No Changeset found

Latest commit: ad80536

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm 🎉

@mrbbot mrbbot added the tre Relating to Miniflare 3 label Nov 17, 2022
@mrbbot mrbbot added this to the 3.0.0 milestone Nov 17, 2022
@mrbbot mrbbot merged commit 339ae67 into tre Nov 18, 2022
@mrbbot mrbbot deleted the tre-cache-fixes branch November 18, 2022 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tre Relating to Miniflare 3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants