Skip to content

Move volatile-cache to workerd#1666

Merged
jasnell merged 7 commits into
mainfrom
jsnell/volatile-cache
Mar 6, 2024
Merged

Move volatile-cache to workerd#1666
jasnell merged 7 commits into
mainfrom
jsnell/volatile-cache

Conversation

@jasnell

@jasnell jasnell commented Feb 13, 2024

Copy link
Copy Markdown
Collaborator

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?
Comment thread src/workerd/server/workerd.capnp
Comment thread src/workerd/server/workerd.capnp Outdated
@jasnell jasnell force-pushed the jsnell/volatile-cache branch 2 times, most recently from b3a28c6 to 9375d63 Compare February 14, 2024 20:43
@jasnell

jasnell commented Feb 15, 2024

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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

jasnell commented Feb 15, 2024

Copy link
Copy Markdown
Collaborator Author

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.

Comment thread src/workerd/api/memory-cache.h Outdated
Comment thread src/workerd/api/memory-cache.h
Comment thread src/workerd/api/memory-cache.h Outdated
Comment thread src/workerd/server/server.c++ Outdated
Comment thread samples/volatile-cache/README.md
@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
Comment thread src/workerd/api/memory-cache.h Outdated
Comment thread src/workerd/api/memory-cache.c++ Outdated
Comment thread src/workerd/api/memory-cache.c++ Outdated
Comment thread src/workerd/api/memory-cache.c++ Outdated
@jasnell jasnell force-pushed the jsnell/volatile-cache branch from a2c6bea to cc026f6 Compare February 28, 2024 19:20
@jasnell jasnell requested a review from kentonv February 28, 2024 19:42
Comment thread src/workerd/api/memory-cache.c++ Outdated
Comment thread src/workerd/api/memory-cache.h
@jasnell jasnell force-pushed the jsnell/volatile-cache branch from cc026f6 to 1ee1e0f Compare March 1, 2024 21:24
@jasnell

jasnell commented Mar 1, 2024

Copy link
Copy Markdown
Collaborator Author

Updated in 1ee1e0f

@jasnell jasnell force-pushed the jsnell/volatile-cache branch from 1ee1e0f to 3d9d698 Compare March 1, 2024 21:25
@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
Comment thread src/workerd/api/memory-cache.c++ Outdated
Comment thread src/workerd/api/memory-cache.h Outdated
@jasnell jasnell force-pushed the jsnell/volatile-cache branch from e20b243 to c5e9895 Compare March 6, 2024 21:35
Comment thread src/workerd/server/server.c++
Comment thread src/workerd/server/server.c++ Outdated
@jasnell jasnell force-pushed the jsnell/volatile-cache branch from c5e9895 to c2488c4 Compare March 6, 2024 22:30
@jasnell jasnell merged commit 5892609 into main Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants