Caching for cloudflare worker

I am trying to enable caching for my cloudflare worker. I have created a page rule like so:

However, when I make a request, I don’t see any “cf-cache-status”. Why not?

Specifically I’d like to get rid of theese GTMetrix errors:

Leverage browser caching for the following cacheable resources: (expiration not specified)

Any ideas?

You have to manipulate cache on the Worker code, using Cache API:

Also, on the dashboard you to set respect existing headers.

Another note, you could manipulate headers this way:

  let req = await fetch("");
  let newHeaders = new Headers(req.headers);
  newHeaders.set("cf-priority", "30/0");

  return new Response(req.body, {
    status: req.status,
    statusText: req.statusText,
    headers: newHeaders