- From: Ian Hickson <ian@hixie.ch>
- Date: Thu, 28 Apr 2011 19:42:40 +0000 (UTC)
On Thu, 9 Dec 2010, Roger H?gensen wrote: > On 2010-12-08 20:44, Ian Hickson wrote: > > 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. > > Actually it would help the browser to display content faster and with less > bandwidth use, > as the html document would have last-modified for <link> elements, > the browser then just checks if the linked element is cached and if it is, is > the last-modified different. > > While currently the browser would make a last-modifed http header request for > the link element. > A <link> or <script> with a href is less likely to change than the html > contents on the majority of sites, > so being able to hint to the browser that this css or that javascript was not > changed saves the browser the (multiple) roundtrips to check if the > last-modified of the css or js file. > > So a last-modifed just lets the web author tell the browser cache that the > link is stale or not stale. > So it's: > 1. http header or http get of html, if not cached or stale or cache heuristics > thinks that last-modified should be re-checked. > 2. do the same with all hrefs, sources etc. in the html document. > vs > 1. same as 1 above but last-modified hinting of href and src allows the > browser to skip step 2 (in well authored or well made template based pages > obviously). > > Damn. I think I skewed this whole topic away from it's original subject to > last-modified being supported by all link/href/src etc. in html in general. > Which may not be a bad idea really, as a last-modified="timestamp_here" > (timestamp is http://www.ietf.org/rfc/rfc2822.txt ) > would only be a few bytes vs a http header call or a full http get call and > added to that the latency/delay in addition. > Shortening last-modified to modified might be something to consider as well. You can basically already do all this by just encoding the last-modified-date into the URL and giving the file a huge expiry time. When the URL changes, the browser knows to fetch a new file. -- Ian Hickson U+1047E )\._.,--....,'``. fL http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 28 April 2011 12:42:40 UTC