Hi Sauma!
[2] I use elementor Hello theme [super minimal plain vanilla] and the only plugin that would change headers would be the converter for media one.
[1] I no longer use any caching plugins since using yours and converter for media plugin.
[3] I did add custom code to htaccess for gzip. Aside from this maybe etag still left in the file from LS Cache. see below my code.
[4] the converter for media plugin adds an .htaccess to uploads folder with:
BEGIN Converter for Media
! — DO NOT EDIT PREVIOUS LINE — !
RewriteEngine On RewriteOptions Inherit RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.jpg.avif -f RewriteRule (.+).jpg$ /wp-content/uploads-webpc/uploads/$1.jpg.avif [NC,T=image/avif,L] RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.png.avif -f RewriteRule (.+).png$ /wp-content/uploads-webpc/uploads/$1.png.avif [NC,T=image/avif,L] RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.gif.avif -f RewriteRule (.+).gif$ /wp-content/uploads-webpc/uploads/$1.gif.avif [NC,T=image/avif,L] RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.webp.avif -f RewriteRule (.+).webp$ /wp-content/uploads-webpc/uploads/$1.webp.avif [NC,T=image/avif,L] RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.jpeg.avif -f RewriteRule (.+).jpeg$ /wp-content/uploads-webpc/uploads/$1.jpeg.avif [NC,T=image/avif,L]
RewriteEngine On RewriteOptions Inherit RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.jpg.webp -f RewriteRule (.+).jpg$ /wp-content/uploads-webpc/uploads/$1.jpg.webp [NC,T=image/webp,L] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.png.webp -f RewriteRule (.+).png$ /wp-content/uploads-webpc/uploads/$1.png.webp [NC,T=image/webp,L] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.gif.webp -f RewriteRule (.+).gif$ /wp-content/uploads-webpc/uploads/$1.gif.webp [NC,T=image/webp,L] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.webp.webp -f RewriteRule (.+).webp$ /wp-content/uploads-webpc/uploads/$1.webp.webp [NC,T=image/webp,L] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/uploads/$1.jpeg.webp -f RewriteRule (.+).jpeg$ /wp-content/uploads-webpc/uploads/$1.jpeg.webp [NC,T=image/webp,L]
! — DO NOT EDIT NEXT LINE — !
END Converter for Media
and it adds in wp-content/ .htaccess:
BEGIN Converter for Media
! — DO NOT EDIT PREVIOUS LINE — !
RewriteEngine On RewriteOptions Inherit RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.jpg.avif -f RewriteRule (.+).jpg$ /wp-content/uploads-webpc/$1.jpg.avif [NC,T=image/avif,L] RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.png.avif -f RewriteRule (.+).png$ /wp-content/uploads-webpc/$1.png.avif [NC,T=image/avif,L] RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.gif.avif -f RewriteRule (.+).gif$ /wp-content/uploads-webpc/$1.gif.avif [NC,T=image/avif,L] RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.webp.avif -f RewriteRule (.+).webp$ /wp-content/uploads-webpc/$1.webp.avif [NC,T=image/avif,L] RewriteCond %{HTTP_ACCEPT} image/avif RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.jpeg.avif -f RewriteRule (.+).jpeg$ /wp-content/uploads-webpc/$1.jpeg.avif [NC,T=image/avif,L]
RewriteEngine On RewriteOptions Inherit RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.jpg.webp -f RewriteRule (.+).jpg$ /wp-content/uploads-webpc/$1.jpg.webp [NC,T=image/webp,L] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.png.webp -f RewriteRule (.+).png$ /wp-content/uploads-webpc/$1.png.webp [NC,T=image/webp,L] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.gif.webp -f RewriteRule (.+).gif$ /wp-content/uploads-webpc/$1.gif.webp [NC,T=image/webp,L] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.webp.webp -f RewriteRule (.+).webp$ /wp-content/uploads-webpc/$1.webp.webp [NC,T=image/webp,L] RewriteCond %{HTTP_ACCEPT} image/webp RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{DOCUMENT_ROOT}/wp-content/uploads-webpc/$1.jpeg.webp -f RewriteRule (.+).jpeg$ /wp-content/uploads-webpc/$1.jpeg.webp [NC,T=image/webp,L]
Header always set Cache-Control “private” Header append Vary “Accept”
! — DO NOT EDIT NEXT LINE — !
END Converter for Media
I have security hardening codes, the WP section and then this in my ROOT .htaccess:
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
BEGIN LiteSpeed
The directives (lines) between "BEGIN LiteSpeed" and "END LiteSpeed" are
dynamically generated, and should only be modified via WordPress filters.
Any changes to the directives between these markers will be overwritten.
SetEnv noabort 1
END LiteSpeed
BEGIN WP Cloudflare Super Page Cache
The directives (lines) between "BEGIN WP Cloudflare Super Page Cache" and "END WP Cloudflare Super Page Cache" are
dynamically generated, and should only be modified via WordPress filters.
Any changes to the directives between these markers will be overwritten.
ExpiresActive on ExpiresByType application/xml "access plus 0 seconds" ExpiresByType text/xsl "access plus 0 seconds"
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
Header set Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=2592000, stale-while-revalidate=86400, stale-if-error=604800"
Header set Cache-Control "public, must-revalidate, proxy-revalidate, immutable, max-age=31536000, stale-while-revalidate=86400, stale-if-error=604800"
RewriteCond %{REQUEST_URI} ^(.)?/wp-content/wp-cloudflare-super-page-cache/sonohz.com/debug.log(.)$ RewriteRule ^(.*)$ - [F]
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
END WP Cloudflare Super Page Cache