Subject: More cache control for (X)HTML pages

From: Nathan <[email-masked]>
Date: Fri, 4 Jan 2013 16:18:48 -0600

Hi, this is my first post so forgive me if I posted in the wrong spot.

I am contemplating writing an RFC on an HTML tag to be placed in the <head>
of a webpage which gives the browser instructions on a single location were
the page may obtain bulk cache information from the server instead of
having each time a new cache-able element is requested having the browser
create a new http request to the server to only have the server respond
with a 304 Not Modified.

I am not going into detail but a quick over view would look something like
(taken from google.com homepage's cache-able files):
<head>
    ...
    <cache src="/script-to-handle-bulk-cache-checking">
        <file href="images/srpr/logo3w.png" />
        <file href="
xjs/_/js/s/c,sb,cr,vm,cdos,jsa,sf,tbpr,tbui,rsn,ob,mb,lc,hv,cfm,klc,kat,aut,esp,erh,bihu,amcl,kp,lu,m,rtis,shb,sfa,hsm,j,p,pcc,csi/rt=j/ver=K-W_gw26Qd4.en_US./d=1/sv=1/rs=AItRSTP1F4RezC8aHlgXoNQaBhX3N9n9sQ"
/>
        <file href="extern_chrome/edf8435073bcf94.js" />
        <file href="
xjs/_/js/s/sy10,gf,sy45,sy46,sy81,sy44,sy39,sy82,sy8,sy34,sy50,sy48,sy80,sy99,sy105,sy108,sy9,sy15,mbtt,ssi,ifl/rt=j/ver=K-W_gw26Qd4.en_US./d=0/sv=1/rs=AItRSTP1F4RezC8aHlgXoNQaBhX3N9n9sQ"
/>
        <file href="textinputassistant/tia.png" />
        <file href="images/nav_logo114.png" />
    </cache>
    ...
</head>

The browser would then block until it cross references it's own cache with
the listed files and (if > 1) send a request to the location specified in
the "src" attribute in the "cache" tag with the cross referenced files list
and the associated "if-modified-since" date of each file. The server would
then respond telling the browser to use the cache for the files that can be
used for cache. Any other files need to be loaded load like normal.

The idea would be to have a page with many images, javascript, css, exc...
to do a single request in the hopes that the it could save any of those
cache-able files from needing their own request to the server to see if
they have been modified.

If there is already an RFC for this a link to it would be appreciated as I
looked for one and came up with only http header cache controls which does
not work the same way.

Thank you,
-Nathan Bruer

---

From: Mark Nottingham <[email-masked]>
Date: Sat, 5 Jan 2013 09:47:26 +1100

Hi Nathan,

Have you looked at the HTML5 AppCache? It operates in a manner similar to what you're describing.

http://www.whatwg.org/specs/web-apps/current-work/multipage/offline.html

That said, most people seem to agree that AppCache is somewhat problematic; although some do use it, it's fairly fussy to work with, and adoption hasn't been wide. Also, note that it creates a cache that's separate to the "normal" HTTP cache.

If you want to propose this particular mechanism, I'd recommend talking to the WHAT WG <http://www.whatwg.org/> and making sure that the HTTPBIS WG <http://trac.tools.ietf.org/wg/httpbis/trac/wiki> is looped in; because it involves both HTML and HTTP caching, it touches both. However, I'd observe that what you're *really* trying to do is to overcome the limitations of HTTP's current use of TCP, and that's what we're trying to do with HTTP2 in HTTPBIS; if you wait a bit, this shouldn't be necessary.

Regards,

On 05/01/2013, at 9:18 AM, Nathan <[email-masked]> wrote:

> I am contemplating writing an RFC on an HTML tag to be placed in the <head> of a webpage which gives the browser instructions on a single location were the page may obtain bulk cache information from the server instead of having each time a new cache-able element is requested having the browser create a new http request to the server to only have the server respond with a 304 Not Modified.
> 
> I am not going into detail but a quick over view would look something like (taken from google.com homepage's cache-able files):
> <head>
>     ...
>         <file href="xjs/_/js/s/c,sb,cr,vm,cdos,jsa,sf,tbpr,tbui,rsn,ob,mb,lc,hv,cfm,klc,kat,aut,esp,erh,bihu,amcl,kp,lu,m,rtis,shb,sfa,hsm,j,p,pcc,csi/rt=j/ver=K-W_gw26Qd4.en_US./d=1/sv=1/rs=AItRSTP1F4RezC8aHlgXoNQaBhX3N9n9sQ" />
>         <file href="xjs/_/js/s/sy10,gf,sy45,sy46,sy81,sy44,sy39,sy82,sy8,sy34,sy50,sy48,sy80,sy99,sy105,sy108,sy9,sy15,mbtt,ssi,ifl/rt=j/ver=K-W_gw26Qd4.en_US./d=0/sv=1/rs=AItRSTP1F4RezC8aHlgXoNQaBhX3N9n9sQ" />
> The browser would then block until it cross references it's own cache with the listed files and (if > 1) send a request to the location specified in the "src" attribute in the "cache" tag with the cross referenced files list and the associated "if-modified-since" date of each file. The server would then respond telling the browser to use the cache for the files that can be used for cache. Any other files need to be loaded load like normal.
> 
> The idea would be to have a page with many images, javascript, css, exc... to do a single request in the hopes that the it could save any of those cache-able files from needing their own request to the server to see if they have been modified.
> 
> If there is already an RFC for this a link to it would be appreciated as I looked for one and came up with only http header cache controls which does not work the same way.
> 
> Thank you,
> -Nathan Bruer

--
Mark Nottingham   http://www.mnot.net/