Astro caching with output = server

I added
Astro.response.headers.set("Cache-Control", "public, s-maxage=60, stale-while-revalidate=30");

to one of my pages deployed with @astrojs/cloudflare and I do see the response header in my network tab, but it's seemingly not caching anything. I am displaying the current time and it changes every time I refresh the page. Shouldn't it cache the HTML for 60 seconds? Output is set to server and the page is just this
---
const currentTime = new Date().toLocaleTimeString();

Astro.response.headers.set('Cache-Control', 'public, s-maxage=60, stale-while-revalidate=30');
---

<html>
<head>
  <title>Current Time</title>
</head>
<body>
  <h1>The current time is: {currentTime}</h1>
</body>
</html>
Was this page helpful?