Caching worker responses in Tiered Caching with Fetch API, similar to Cache API.
I have tiered caching enabled, so I cannot use the Cache API to save worker response while returning. What I can use is Fetch API, is there any way to save cache with Fetch API, similar to how we do with Cache API (caches.put). Basically, what I want to do is, cache the API response with Fetch.
Flow:
Flow:
- Example API: GET /employee
- Call with GET /employee
- If cache is present --> return from cache with HIT
- If absent --> Cache with fetch API for subsequent API calls.
- All of this should happen within the worker code.
- The API call should not go into worker execution and should return from the Edge cache.