Hi there -
I have seen similar posts but not sure how page rules and the output of a worker work. Supposed I have a worker function
async function handleApiRequest(request) {
let cache = caches.default
let response = await cache.match(request)
const responseInit = {
headers: {'Content-Type': 'application/json'},
}
const combined = {
tim: new Date()
}
response = new Response(JSON.stringify(combined), responseInit)
response.headers.set("Cache-Control", "public, max-age=1");
event.waitUntil(cache.put(request, response.clone()))
}