How to Cache API response, with Hono JS & workers

Hello all newbie here, I am making an API where in an endpoint I am calling a third party API and sending a JSON response to the client.
I tried adding cache headers to the fetch API, but I am not able to see any cf-cache-status in the headers.

My approach
app.get('/', async (c) => {
  const res = await homeController();
  return c.json(res);
});


Home controller calls the api

const homeController = async () => {
  const res = await fetch('example.com', {
    method: 'GET',
    cf: {
      cacheEverything: true,
      cacheTtlByStatus: {
        '100-199': 0,
        '200-299': 14400,
        '300-599': 0,
      },
    },
    headers: {
      'Cache-Control': 'public, max-age=14400',
    },
  });
  const data = await res.json();
  return data;
};


i have set the cache-control headers, but cannot see the cf-cache-status header can anyone tell me what am i doing wrong. also i am not using fetch exported by cloudflare.
Screenshot_2023-10-30_at_11.09.34_PM.png
Was this page helpful?