This question is for a Wordpress site with -cache=on.
The cache-control header "public, no-cache" is set in common/headers-html.conf but browsers and CDNs are unable to cache the html assets because there is no ETag header set.The server will always return 200 and download the html again instead of responding with a 304 if the html has not changed.
There is an ETag header set for static assets (.css, .js, images, etc) but nothing for the html asset. I have modified the common/headers.conf file as follows, but there is still no ETag header set.
add_header Cache-Control "public, no-cache";
add_header Referrer-Policy "no-referrer-when-downgrade";
#add_header Content-Security-Policy " ";
#edit by James may get overwritten
expires max;
etag on;
I am now getting cache-control: max-age and expires headers in addition to the cache-control: public, no-cache, but still no ETag header for the html/page asset.
I am trying to figure out where the ETag header gets set for the static assets, but I don't see anything in common/locations.conf other than "expires: max".
My goal is for browsers and CDN to cache the html and for nginx to send a 304 response instead of 200 if the page has not changed.