This worker READS from the cache. The cache-writer worker should have written to it first.
Testing if Cache API is shared between two workers on the same account.
Run all tests to check if any cache type is shared:
Run All Tests Self Test (verify Cache API works)First, go to Cache Writer and write to each cache type.
Try to read what writer stored in caches.default
Try to read what writer stored in the named cache
Read from Named CacheTry to read using this worker's zone URL as the cache key
Read from Zone URL Cache| Cache Type | Cache Key URL | Hypothesis |
|---|---|---|
caches.default |
https://shared-cache-test.internal/KEY |
Probably NOT shared - internal URL doesn't match zone |
caches.open('name') |
https://shared-named-cache.internal/KEY |
Unknown - might be per-account or per-worker |
caches.default (zone) |
https://cache-reader.erfianugrah.com/cached/KEY |
Most likely to work - uses same zone URL |
If cache IS shared:
If cache is NOT shared:
Writer uses Cache API to cache. Reader does plain fetch(). Does reader get cached response?
Run Full Test (clears cache first)Single fetch:
Fetch from Writer (once)