eTag header set by the server is getting replaced

When our application goes behind the Cloudflare CDN we the header eTag gets affected.

Not through Cloudflare (observed valid header):
etag: “MjAyMS0wOC0xMlQxMTo0NzowOCswMDowMC4uMA==”

Through Cloudflare (observed invalid/amended header):
etag: W/“MjAyMi0wMS0xMlQwODoxNzowNiswMDowMC4yMDIxLTA4LTAzVDA1OjEwOjAyWi4xMg==”

Article like this ( https://support.cloudflare.com/hc/en-us/articles/218505467-Does-CloudFlare-support-ETag-headers- ) does not help.

Even a Rule that sets cache to Bypass and disables all Cloudflare apps does not help.

With CloudFront CDN (AWS) as an example this is controlled with behaviour very well. We are very surprised it doesn’t with Cloudflare.

Has anyone had this pain before and managed to solve it?

1 Like

From the link above:

When using weak ETag headers, disable Email Obfuscation and Automatic HTTPS Rewrites to ensure Cloudflare doesn’t remove the ETag headers set by your origin web server.

Just to conclude, Cloudflare Apps is not the same as options (or features which we can enable) like Email obfuscation, Automatic HTTPS Rewrites, Rocket Loader rather Apps from the Cloudflare App Center as follows on the link below:

Recent topic:

I am sending ETag for resources like images, CSS, JS from my origin host/server, but using Origin Cache Control in a Page Rule (including Cache Level: Cache Everything).

1 Like

The thing is, Cloudflare doesn’t remove the ETag headers set by our origin web server, it changes it. I’ve tried to disable Email Obfuscation and Automatic HTTPS Rewrites but those had no effect… Cloudflare was still interfering with the eTag.

Having the same problem.
My server is sending back an e-tag and Cloudflare is overwriting it with another e-tag. How to disable this functionality?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.

I’d comment on this post: eTag header set by the server is getting replaced, but it has been closed.

My server responds with ETag: “cee089074d302bdcafa743f072923d3f”, but when using Cloudflare, the response contains etag: W/“cee089074d302bdcafa743f072923d3f”.

I have tried disabling “Email obfuscation” and “Automatic HTTPS rewrites”, but still no success.

How does one prevent Cloudflare from modifying the etag HTTP header?

Here’s the response from the official docs:

Strong ETags

Domains on Enterprise plans enable strong ETag headers via a Respect Strong ETags Page Rule. Otherwise, strong ETag headers are converted to weak ETag headers. Also, set a strong ETag header in quotes (Etag: “example”) or Cloudflare removes the ETag instead of converting it to a weak ETag.

Without a Page Rule, Cloudflare preserves strong ETags set by the origin web server if:

  • the content is gzipped on the origin server,
  • the origin sends the gzipped content with a strong ETag header, and
  • Rocket Loader, Minification, Email Obfuscation, and Railgun features are disabled.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.