KV Writer/Reader Caching Test

The Scenario

Writer Worker (cache-origin.erfi.me):

Reader Worker (this one - cache-edge.erfianugrah.com):

Test Steps

Step 1: Write Data to Origin's KV

Simulate an event writing data:

Write v1 Write v2 Write v3

Step 2: Read from Origin (Test Caching)

Fetch the data and try different caching strategies:

Strategy Description Action
No caching Direct fetch() - baseline Test
fetch() cf.cacheTtl Uses fetch() with cacheEverything + cacheTtl Test
Cache API Uses caches.default to store response Test

Run the same test twice to see if caching works (check originRequestId)

Step 3: Compare All Strategies

Run all caching strategies and compare results:

Run Comparison Test

Utility Actions

Check KV Status | Delete Test Data | Back to Main Menu

Expected Results

Prediction:

If fetch() caching DOES work, that would mean origin caching somehow helps!

Architecture

Events → [Writer Worker] → KV.put()
                ↓
         KV.get() (fresh, to check version)

Clients → [Reader Worker] → fetch(origin/kv/read) → [Origin Worker] → KV.get() → Response
                ↓
         Can we cache this response at edge?
         Option 1: fetch() cf options (probably DYNAMIC)
         Option 2: Cache API (should work)