Support

Admin Tools

#37680 ETags and litespeed

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Monday, 05 September 2022 09:59 CDT

PereCadena

This is a general question not related to a certain website.

I read the ETAG documentation and some doubts arise.

 

1. If my site runs under LiteSpeed or CloudFlare or any other "speeder"... will ETAGS still perform correctly as if it was on a single server?

Shall I create them with option Size and Time as to ignore the Innode for them two work?

2. It is mentioned that it works for static content only.

How is the static condition determined? Shall I indicate this somehow? is it a dynamic decision made by the server?...

 

 

Thank you.

nicholas
Akeeba Staff
Manager

1. LiteSpeed understands the Etags directive just fine. As you said, use “Size and Time” to ignore the inode as this is considered a security issue under some contexts.

That said, what will happen to ETags since you're using CloudFlare is up to CloudFlare, see https://support.cloudflare.com/hc/en-us/articles/218505467-Using-ETag-Headers-with-Cloudflare. They basically override the ETag value with something else that's CloudFlare specific.

So, just use “Size and Time” and let CloudFlare handle the rest.

2. You do not need to declare which content is dynamic or static, this is an intrinsic property of how this content is retrieved from the web server itself which, of course, your web server already knows :) If it has to go through a CGI / FastCGI handler — like it does for PHP files — it is dynamic content and gets no ETag header at all from the web server. If the content was read directly from the server's disk and transmitted to the web unchanged it's static content and gets an ETag header.

Dynamic content is typically executable scripts: PHP, CGI binaries, Python, Perl, … As a result they do not need ETag headers to help the browser decide whether to cache the content; they use cache control headers. Further to that, ETag headers only work for cache control if the browser can reasonably expect to send a HEAD request and have the web server reply with just the HTTP headers. By definition, this only makes sense for static content. Dynamic content would have to run all the way to generate everything from scratch to return the headers. It would not make sense to have dynamic content run twice for each page load, it'd make sites dead slow and servers too busy for no reason. Conversely, it doesn't make sense for the browser to retrieve all static content in its entirety if it's already in its cache and web servers can return headers for static content super fast (the processing takes nanoseconds on the server!) therefore using the ETag header as de facto cache control makes sense for static content. Now you know why only static content gets an ETag header.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!