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

Move volatile-cache to workerd #1666

Merged
merged 7 commits into from
Mar 6, 2024
Merged

Move volatile-cache to workerd #1666

merged 7 commits into from
Mar 6, 2024

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Feb 13, 2024

First steps to moving volatile-cache to workerd. This will remain draft until the tests are also ported and the internal PR switching over to this is opened.

This is effectively a straightforward port of the version in the internal repo with a callback hook replacing some of the internal-specific additional limits we enforce when resizing.

Key questions to answer:

  • Should we rename the API before it lands here? What should the name be? Renamed to MemoryCache (at least for now)
  • Should any changes be made to the API before it lands here? What changes?
    • getInstance(...) method changed to also accept the ownerId
    • virtual interface added to abstract the actual implementation of the cache map
  • Should any changes be made to the binding configuration before it lands here? What changes?
    • id field is now optional
  • Should the implementation be updated to use memcache now or later?

@jasnell jasnell force-pushed the jsnell/volatile-cache branch 2 times, most recently from b3a28c6 to 9375d63 Compare February 14, 2024 20:43
@jasnell
Copy link
Member Author

jasnell commented Feb 15, 2024

Do we want to mark this experimental initially until we're ready to enable this in production or is landing it without the experimental flag ok here?

@irvinebroque
Copy link
Collaborator

Really seems like needs to be experimental flag.

@jasnell jasnell marked this pull request as ready for review February 15, 2024 14:57
@jasnell jasnell requested review from a team as code owners February 15, 2024 14:57
@jasnell
Copy link
Member Author

jasnell commented Feb 15, 2024

Given that this is renamed, it will no longer conflict with VolatileCache in the internal repo and shouldn't need to wait for the internal repo to be updated to land.

src/workerd/api/memory-cache.h Show resolved Hide resolved
src/workerd/api/memory-cache.h Outdated Show resolved Hide resolved
src/workerd/server/server.c++ Outdated Show resolved Hide resolved
samples/volatile-cache/README.md Outdated Show resolved Hide resolved
@jasnell jasnell marked this pull request as draft February 16, 2024 16:50
@jasnell

This comment was marked as resolved.

@jasnell jasnell force-pushed the jsnell/volatile-cache branch 2 times, most recently from 97b6d5c to 5023de9 Compare February 17, 2024 22:43
@jasnell jasnell marked this pull request as ready for review February 17, 2024 22:52
@jasnell jasnell force-pushed the jsnell/volatile-cache branch 2 times, most recently from fd68ef1 to a2c6bea Compare February 21, 2024 21:54
src/workerd/api/memory-cache.h Outdated Show resolved Hide resolved
src/workerd/api/memory-cache.c++ Outdated Show resolved Hide resolved
src/workerd/api/memory-cache.c++ Outdated Show resolved Hide resolved
src/workerd/api/memory-cache.c++ Outdated Show resolved Hide resolved
@jasnell
Copy link
Member Author

jasnell commented Mar 1, 2024

Updated in 1ee1e0f

@jasnell jasnell requested a review from kentonv March 1, 2024 21:27
@jasnell jasnell force-pushed the jsnell/volatile-cache branch 3 times, most recently from cda0b78 to e20b243 Compare March 6, 2024 17:10
src/workerd/api/memory-cache.c++ Outdated Show resolved Hide resolved
src/workerd/api/memory-cache.h Outdated Show resolved Hide resolved
src/workerd/server/server.c++ Show resolved Hide resolved
src/workerd/server/server.c++ Outdated Show resolved Hide resolved
@jasnell jasnell merged commit 5892609 into main Mar 6, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants