Writer Worker (cache-origin.erfi.me):
Reader Worker (this one - cache-edge.erfianugrah.com):
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)
Prediction:
fetch() cf.cacheTtl will return DYNAMIC (won't cache CF-proxied origin)Cache API will work and return HIT on second requestIf fetch() caching DOES work, that would mean origin caching somehow helps!
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)