Entity tags, or ETags, as they are commonly referred to, are a type of mechanism used in the HTTP header to help validate and identify whether an element or component in the cache matches that on the server. While the use of entity tags is not mandatory, an entity tag provides a way for the browser check the server if content or a file has changed. If the content or file has not changed, then the server can save resources and bandwidth by not having to provide the full header response (only if the file or content has not changed). In this way, entity tags are like a fingerprint and are unique to the server they are connected to.
Configure Entity Tags (ETags)
What are Entity Tags (ETags)?
How Entity Tags Work
Entity tags are typically represented by a string of ASCII (American Standard Code for Information Interchange) characters placed within double quotation marks and would look like the following:
There is also another method that is considered a weak validation and it would look like the following:
ETag: W/ “420af-6473-8634”
Configuring Entity Tags Correctly
So, while this all seems straightforward, issues can begin if your website is hosted on multiple servers. Like mentioned previously, entity tags are unique to the server they are connected to. If you are accessing a site that uses a single web server, and the entity tags match, then the server would respond with a 304 Not Modified response. However, if you have a situation where a website uses multiple servers, the entity tags will not match. In this case, the response must come from the origin server instead of the browser cache, which as you would expect, takes longer. The site will take longer to load and potentially result in a poor user experience. Bottom line: if you use entity tags, make sure to set them up correctly. If not, they can cause unnecessary performance issues.
Lighthouse is an open-source tool that is used to run an audit against your web pages and provides scores and suggestions for improving page performance, accessibility, SEO, and more.
PageSpeed Insights is a tool created by Google that reports on the performance of a page on both mobile and desktop devices, and provides suggestions on how that page may be improved.