docs: add caching guide - #3251
Conversation
@vinext/cloudflare
create-vinext-app
@vinext/types
vinext
@cloudflare/workers-response-store
commit: |
|
Performance benchmarksCompared 0 improved · 0 regressed · 6 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
|
/bigbonk review for issues Please complete the review within 8 minutes. |
|
|
||
| | Setup | Response storage | Data storage | Best for | Main trade-off | | ||
| | ------------------------------------ | -------------------------- | ---------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | | ||
| | No persistent cache | None | None | Dynamic apps and initial migrations | Every request may need to render and fetch its data | |
There was a problem hiding this comment.
The no-adapter setup still uses the default MemoryCacheHandler (50 MiB per isolate unless cacheMaxMemorySize changes it) for both data and origin-managed ISR responses. Labeling both stores as None makes this setup sound fully uncached; please describe the per-isolate memory cache and its lack of shared persistence instead.
| | Workers Cache + data cache | Workers Cache | Workers KV | Fast edge responses using Cloudflare's native caches | Cached responses have no durable backing store, and a hit in one region does not guarantee a hit elsewhere | | ||
| | Data cache | Workers KV | Workers KV | A simple persistent cache without Workers Cache | Requests still reach the Worker and KV is eventually consistent | | ||
|
|
||
| When caching is enabled through `vinext init`, Workers Response Store is the default choice. |
There was a problem hiding this comment.
This is not the current vinext init behavior. The initializer only offers workers-cache or data-cache for the CDN cache and kv or none for data, defaulting to Workers Cache plus KV (init-platform.ts). It cannot select responseStoreAdapter() at all. Please remove this claim (and the corresponding “these choices” claim near the end) or add initializer support first.
| vinext({ cache: responseStoreAdapter() }); | ||
| ``` | ||
|
|
||
| The default service-binding mode keeps the cache service in a separate Worker. `vinext init` creates `wrangler.response-store.jsonc` alongside the application config and adds a deployment script: |
There was a problem hiding this comment.
vinext init does not create either wrangler.response-store.jsonc or a deploy:response-store script; these names occur nowhere in the implementation. Service-binding mode currently requires a separately configured cache Worker plus the application Worker RESPONSE_STORE and version-metadata bindings. As written, readers following this guide will have neither the referenced script nor the required bindings, so this section needs the actual manual setup or initializer support.
|
Submitted 3 actionable inline findings. |
Summary
Testing
vp fmt --check README.md docs/caching.md