Hi!
We’re currently building a new application that will serve as a proxy for our main NextJS application. This proxy will run at the edge and we’re using Hono as our framework of choice. So far, this going pretty well. Hono is running super fast and the DX is great!
However, I can’t seem to get the Netlify Edge cache to work. I’m adding the correct caching headers to the response, but I see that the cache isn’t being followed correctly. When I add a simple console.log in the route that I want to cache, I see the console.log every time I call that specific endpoint. When I inspect the headers, I see the correct headers being set, thus expecting that the cache is hit.
These are the headers that I set manually on the response:
response.headers.set("Netlify-CDN-Cache-Control", `public, max-age=1800, must-revalidate`);
response.headers.set("CDN-Cache-Control", `public, max-age=1800, must-revalidate`);
response.headers.set("Cache-Control", `public, max-age=1800, must-revalidate`);
response.headers.set("Netlify-Vary", "query=url");
Can you help with this issue? Perhaps I’m missing something or doing something incorrectly.
Looking forward to your reply!
With kind regards,
Peter