[whatwg] Offline Web Apps

Maciej Stachowiak mjs at apple.com
Fri Aug 24 14:12:22 PDT 2007


On Aug 23, 2007, at 8:56 PM, Aaron Boodman wrote:

> On Aug 23, 2007 8:18 PM, Ian Hickson <ian at hixie.ch> wrote:
>> On Thu, 23 Aug 2007, Maciej Stachowiak wrote:
>>>
>>> I haven't read over the details but there seems to be an obvious
>>> showstopper problem: this won't work for web applications that  
>>> consist
>>> of more than one page.
>>
>> Indeed, that was called out as a potential issue. But is that  
>> really a
>> problem? It's easy to work around (e.g. with iframe)s if you really  
>> must
>> have multiple "top-level" pages, but aren't web apps moving to a  
>> one-page
>> model anyway?
>>
>> The problem gets significantly more complicated with multiple top- 
>> level
>> pages all taking part in the same conceptual application.
>
> The single-page model has other nice advantages. For example, there's
> never any confusion about which cache should serve a resource. It's
> the one that's associated with the application which the resource is
> contained in.
>
> Could multi-page apps be addressed by letting applications specify
> that other applications should be cached (using a similar api to the
> one that lets applications programatically cache resources)?

I don't think that works very well - you'd have to parse all the HTML,  
CSS and scripts associated with those other pages just to do the  
caching. That's a huge cost compared to just downloading the  
resources. Consider web apps like flickr and upcoming which consist of  
many many pages. Obviously these specific examples can't cache all of  
their pages offline but they may well want to cache a significant  
subset that is interesting to the user.

I think it's easy to extend Ian's idea in a way that keeps it really  
simple for the simple case, but that works better for the multi-page  
case or other complex cases where pages load some resources dynamically.

<html application="manifest-file">

The manifest file would indicate all resources used by the web app,  
including other pages, and other resources that may be loaded by the  
current page but normally would not be at startup (another problem  
with Ian's proposal IMO). Multiple pages that refer to the same  
manifest are considered part of the same web app and share the same  
cache. If you give an empty value for the application attribute, then  
the implicit thing that Ian describes happens - the resources that the  
page actually loads are the ones cached.

My thoughts on this aren't fully fleshed out, but Ian said he wants to  
start editing the spec right away so I wanted to give this minimal  
feedback before he writes up something in detail that I would strongly  
object to.

Regards,
Maciej





More information about the whatwg mailing list