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

[Miniflare 3] Re-implement Cache gateway using new storage system #562

Merged
merged 7 commits into from
May 9, 2023

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Apr 28, 2023

This PR builds on #555, and re-implements the Cache gateway using the new storage system. Specifically, it uses the same abstract expiring-key-value-metadata store as the KV gateway. The gateway now uses streams all the way from the incoming request to the blob store. 🙂

Whilst implementing this, I noticed tests passing but hanging. 😕 I'm hoping the ava bump should've fixed this. You may wish to review this in isolation. 👍 (alternatively fixing #532 will mean we don't need to use AVA shared workers for getting ports, which seem to be the buggy component)

Closes DEVX-590

This attempts to fix an issue where tests would pass, but AVA would
hang. Step-through debugging doesn't seem to work when the
`workerThreads` option is enabled either.
@mrbbot mrbbot added the tre Relating to Miniflare 3 label Apr 28, 2023
@mrbbot mrbbot requested a review from a team April 28, 2023 15:17
@changeset-bot
Copy link

changeset-bot bot commented Apr 28, 2023

⚠️ No Changeset found

Latest commit: 727b069

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

@mrbbot mrbbot force-pushed the tre-new-storage-cache branch from 51cf124 to 727b069 Compare April 28, 2023 15:20
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.

Looking great!

packages/tre/src/plugins/cache/errors.ts Show resolved Hide resolved
packages/tre/test/test-shared/http.ts Show resolved Hide resolved
packages/tre/test/test-shared/http.ts Show resolved Hide resolved
packages/tre/test/plugins/r2/index.spec.ts Show resolved Hide resolved
packages/tre/src/plugins/cache/gateway.ts Outdated Show resolved Hide resolved
packages/tre/src/plugins/cache/gateway.ts Show resolved Hide resolved
packages/tre/src/plugins/cache/gateway.ts Show resolved Hide resolved
packages/tre/src/plugins/cache/gateway.ts Show resolved Hide resolved
packages/tre/src/plugins/cache/gateway.ts Show resolved Hide resolved
mrbbot added 5 commits May 4, 2023 18:03
Add test for parsing Cache API messages from `workerd`
Extract parameters to `getMatchResponse()` into separate type
Remove `log` member on `CacheGateway`
Assert `resHeaders` created as opposed to `??=`
@mrbbot mrbbot requested a review from penalosa May 4, 2023 17:12
@mrbbot mrbbot merged commit 9a71e86 into tre May 9, 2023
@mrbbot mrbbot deleted the tre-new-storage-cache branch May 9, 2023 14:05
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.

3 participants