HTML and CSS Reference
In-Depth Information
Introduce ETag
Provide ETags for semistatic pages generated by web applications.
Code View:
Date: Mon, 09 Apr 2007 13:41:12 GMT
Server: Apache/2
X-Powered-By: PHP/5.2.0
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Last-Modified: Mon, 09 Apr 2008 13:41:13 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Content-Style-Type: text/css
Keep-Alive: timeout=15, max=98
Connection: Keep-Alive
Transfer-Encoding: chunked
ETag: "6548d4-30a9e-c7f4e5c0"
Date: Mon, 09 Apr 2008 13:41:12 GMT
Server: Apache/2
X-Powered-By: PHP/5.2.0
Expires: Wed, 11 Jan 1984 05:00:00 GMT
Last-Modified: Mon, 09 Apr 2007 13:41:13 GMT
Cache-Control: no-cache, must-revalidate, max-age=0
Content-Style-Type: text/css
Keep-Alive: timeout=15, max=98
Connection: Keep-Alive
Transfer-Encoding: chunked
Motivation
ETags enable a client to quickly check that a page has not changed without downloading the entire page again.
This saves server and client bandwidth and speeds up page load times.
Potential Trade-offs
You shouldn't provide ETags for pages that update very frequently, in particular more frequently than a client
will access them.
ETags can also take non-negligible CPU time to calculate. This usually isn't a big deal, but on a server that is
CPU-limited (as opposed to bandwidth-limited), this might be a concern.
Mechanics
ETag stands for "entity tag." It's a server-scoped identifier for the data sent by a server to a client in response
to a request for a particular URL. It's supposed to change when the entity changes and stay the same otherwise.
The first time a browser or other client requests a page from a server, it notes the entity tag of that page. The
next time it needs to request that page, it can include the ETag in an If-None-Match header, like so:
Search WWH ::




Custom Search