Cloudflare Pages not including Etag header

For Workes & Pages, what is the name of the domain?

listening-spaces.pages.dev

What is the issue or error you’re encountering

The page is not being served with the Etag header.

What steps have you taken to resolve the issue?

I was initially trying to debug this on a custom domain (listeningspaces.net) managed and proxied by Cloudflare. That led me to these docs:

And I took the steps described in those to disable any Cloudflare features that could be causing the Etag header to not be included.

After failing to solve the issue that way, I began trying to solve this on the Cloudflare Pages URL (listening-spaces.pages.dev) in order to bypass any incorrect configuration that I might have on my custom domain, but I’m still unable to get the Etag header to make it to my browser.

From this page (Serving Pages | Cloudflare Pages docs): “For browser caching, Pages always sends Etag headers for 200 OK responses”

Does anyone know of other reasons that the Etag header might not be making it to browsers for this site? Thank you!

Hi @jamesbvaughan,

I found a similar case in the Community that may be helpful to you. Could you please review this thread and let us know if it helped you?

Cloudflare may be Cloudflare removing the Etag header because your server tells clients and Cloudflare to not cache any content.

I hope this helps, but please let us know if you need further assistance.

Thanks for the reply! As far as I can tell, that thread is not helpful in this case.

I’m specifically trying to get the Etag header to show up on a Cloudflare Pages site, where I have minimal control over the server behavior. (Eventually I’d like to get the Etag header to make it all the way through my custom domain, proxied by Cloudflare, but for now I’m trying to narrow down the problem and focus just on the page as its being served on the *.pages.dev domain.)

This docs page claims that “Pages always sends Etag headers for 200 OK responses”: Serving Pages | Cloudflare Pages docs
It makes no mention of things that might be causing the header to be removed.

The only potentially relevant things in my control that I could think of on a Cloudflare Pages site are the manual headers control via the _headers file and Web Analytics, which injects a script into the page. I’ve tried with and without Web Analytics, and I’ve tried with and without a _headers file.

Is there anything else I can try here?

I’ve got the same issue here on a pure, minimal Cloudflare Pages project. I noticed that CSS, mages, etc. get an ETag header (some strict, some weak), while HTML does not. I don’t have a _headers file or any other caching-related configuration.

HTML page: https://cf-pages-playground-5j0.pages.dev/ (without etag)
CSS page: https://cf-pages-playground-5j0.pages.dev/theme/css/main.css (with etag)

I requested the resources using curl via HTTP/2. In both cases, I get a Cache-Control header though:

cache-control: public, max-age=0, must-revalidate