Etag isn't always kept unless `Security` and `Performance` are disabled

The issue

After following the official docs to allow server Etags:

I found that the HTML responses Etags are randomly removed for some users and kept for other users. For instance, for me are kept on Firefox, Edge, and a private Chrome window, but not on a regular Chrome window (even after deleting cache and cookies). Meanwhile for other users are always kept.

The use case for etags
My application loads different static web apps(with different index.html weak Etags) under the same URL, NGINX maps this. When the ETag is missing the browser will get a 304 response even when NGINX is pointing to a different application, this makes the user load the wrong application.

My “temporal” solution

After following this answer

I have disabled Security and Performance for the HTML paths and it seems like the Etag will not be removed anymore.

My questions

Is this maybe because some feature like Rocket Loader is changing the HTML making the Etag invalid and because of that removing the header?
I would like to know if there is a better way to solve this without disabling all the security and performance features.

Thank you!

CF Email Address Obfuscation feature could change the HTML of a page for etags IIRC. Do you have that enabled ?

Tried disabling Rocket Loader to confirm your theory too ?

This topic was automatically closed after 14 days. New replies are no longer allowed.