[whatwg] Proposal: add attributes etags & last-modified to <link> element.

Ian Hickson ian at hixie.ch
Wed Dec 8 11:44:14 PST 2010

On Wed, 15 Sep 2010, Gavin Peters (è~S~Kæ~V~G彼德æ~V¯) wrote:
> Hi, I'm working on link tags inside of chrome.  We're now experimenting 
> with an optimization that uses link tags and headers to avoid round 
> trips for cache validation in many cases.
> I propose we add an optional etags & last-modified attribute to the link 
> element.  If present for an http uri, these tags represent an assertion 
> about the current cache status of the target resource.  A browser that 
> has a cached resource for that uri with the same etags and/or 
> last-modified may present the link data without validation in connection 
> with the link retrieval.  A browser that has a cached resource for that 
> uri which has a different etags and/or last-modified should treat the 
> resource as if it is in need of validation for retrieval, even if normal 
> cache expiry would treat the resource as valid.
> I anticipate that these attributes will be more commonly (and probably 
> safely) used on the Link: header than in the link element.  When used, 
> they have the potential to save a browser many round trip cache 
> validations (304s) even for data with short cache expiry, and to also to 
> potentially allow early cache-expiry for resources which change ahead of 
> their cache validity period.  These are both great speedups; page loads 
> should be faster and network use should be reduced.

As others have pointed out, these don't seem to add anything to the 
equation that couldn't also be handled by simply changing the URL and 
giving the resources essentially infinite cacheable lifetimes. In both 
cases, the HTML document has to be changed (in the same location even). 
The advantage of the URL trick is it works today, and is probably easier 
to understand (most authors are unlikely to know how to find their ETags 
even if they knew what they were, for instance).

On Mon, 20 Sep 2010, Roger HÃ¥gensen wrote:
> It would be better to define this as explicitly indicating which 
> resources are NOT valid any longer, with most sites/web applications 
> this would only be a select few links.

Doing that would require knowing what the browser's cache contains.

I haven't added this to the spec yet. However, I encourage experimentation 
-- that's how we work out what the spec should say; if this turns out to 
be popular and effective, we should reconsider adding it to the language.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list