<div dir="ltr">On Sat, Sep 6, 2008 at 8:46 AM, Chris Prince <span dir="ltr"><<a href="mailto:cprince@google.com">cprince@google.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think Michael has some valid concerns here.  Specifically, where he says:<br>
<br>
- "Where does appCache deletion happen?"<br>
<br>
and<br>
<div class="Ih2E3d"><br>
- "I think the appCache update/validation logic is fundamentally flawed<br>
   with regard to resources that are not explicitly listed."<br>
<br>
</div>Is anybody else working on the Offline Web Applications feature?<br>
<font color="#888888"></font></blockquote><div><br>Dave Camp and Honza Bombas at Mozilla (CCed).<br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888"><br>
--Chris<br>
</font><div><div></div><div class="Wj3C7c"><br>
<br>
On Fri, Aug 29, 2008 at 4:36 PM, Michael Nordman <<a href="mailto:michaeln@google.com">michaeln@google.com</a>> wrote:<br>
> Hello again all,<br>
><br>
> A couple more comments.<br>
><br>
> When is anything ever deleted?<br>
><br>
> Maybe i missed it, but where does appCache deletion happen?<br>
><br>
> Something that Gears user's have done is to serve an empty manifest file.<br>
> The results are a close approximation to having deleted the resource store.<br>
> I would vote to have some syntax for expressing 'delete me'  in the manifest<br>
> file for an appCache. A new type of event may be warranted for completion of<br>
> such an update, and when swapCache() is called there would no longer an<br>
> appCache associated with the context.<br>
><br>
> Should we revisit the caching semantics for any resource not explicitly<br>
> listed in the manifest?<br>
><br>
> Unless i missed something, I think the appCache update/validation logic is<br>
> fundamentally flawed with regard to resources that are not explicitly<br>
> listed. As presently spec'd, a failure to update/validate any of these<br>
> resources causes the entire update to fail, and the old version will<br>
> remain pinned in the cache. Now suppose the app changes it's url space such<br>
> that some of the resources that got picked up by one of the mechanisms to<br>
> add new resources (autocaching namespace or manually .add()ed or <html<br>
> manifest=x>) no longer make sense... i think this means the appCache is<br>
> stuck in time.<br>
><br>
> One idea is to rephrase this feature in terms closer to std http caching for<br>
> all entries that do not explicily appear in the manifest file. In<br>
> effect, closer to telling the http cache to not purge the resource.<br>
><br>
> * at initial cache time<br>
>   - cache the resource<br>
><br>
> * at appCache update time<br>
>   - validate all non-explicit entries per usual http caching semantics<br>
>      (so 404s  will remove these entries at update time)<br>
>   - network/server errors do not fail the larger update<br>
>   - beyond that, not sure what todo on network/server errors... remove or<br>
> retain the resources?<br>
>   - perhaps maintain a list of 'failed to update' items that the webapp can<br>
> access via script<br>
><br>
> * at resource load time<br>
>   - validate per usual http caching rules going forward<br>
>     (so 404s will remove these entries)<br>
>   - with the following exceptions<br>
>      - use the cached resource as a fallback for network or server(5xx)<br>
> errors<br>
>      - do not purge the resource upon expiration<br>
><br>
> Comments?<br>
><br>
><br>
> On Mon, Aug 25, 2008 at 11:54 AM, Michael Nordman <<a href="mailto:michaeln@google.com">michaeln@google.com</a>><br>
> wrote:<br>
>><br>
>> Hello all,<br>
>><br>
>> I have many comments on the Offline Web Applications corner of the HTML5<br>
>> spec. This is the first round of comments you'll see coming from me. This<br>
>> one is mostly top-level comments.<br>
>><br>
>> 5.7.2 Application caches<br>
>><br>
>> I found the terminology used to describe the contents of the<br>
>> cache sometimes contradictory and confusing, and it doesn't correspond<br>
>> directly with the terminology used in the manifest file syntax. FWIW, some<br>
>> word smithing and reconciling the differences could add clarity to the spec.<br>
>><br>
>> cached resource categories<br>
>><br>
>> * implicit category<br>
>> This categorization applies to html docs which explicitly contain a<br>
>> reference to the manifest file via the 'manifest' attribute of their <html><br>
>> tag. I understand they are not necessarily explicitly listed in the manifest<br>
>> file, but they may also be explicitly listed. The end result is that a<br>
>> resource can be categorized as both 'implicit' and 'explicit'. This is<br>
>> confusing. I'd vote to have a different name for clarity sake... some<br>
>> ideas... 'toplevel', 'manifest referencing', 'native' (an awkward play on<br>
>> foreign).<br>
>><br>
>> * manifest category<br>
>> Perfect.<br>
>><br>
>> * explicit category<br>
>> Ok provided 'implicit' is renamed.<br>
>><br>
>> * fallback category<br>
>> The term 'fallback' refers to the prescribed use of these resources for<br>
>> the opportunistic-caching namespace in particular. As part of pulling apart<br>
>> namespaces vs how to handle hits within a namespace, I'd vote to change the<br>
>> name for this category... some ideas... 'namespace-handler'.  I'll say more<br>
>> more to say about different types of 'namespaces' below.<br>
>><br>
>> * opportunistcally cached category<br>
>> A mouthful, but ok. Another possibility is 'auto-cached' which would work<br>
>> well with the 'manually-cached' terminology below.<br>
>><br>
>> * dynamic category<br>
>> I'd like to reserve the term 'dynamic' for a different use of that term<br>
>> (more on that in a moment).  Some name possibilites for this category...<br>
>> 'manually-cached' or 'script-added' or 'programatically-added'.<br>
>><br>
>>  flavors of namespaces<br>
>><br>
>> * online whitelist<br>
>> As mentioned in previous messages, this would need to be some form of<br>
>> namespacing or filtering to be useful. A better term for this might be<br>
>> 'bypass' since with respect to the appcache, hits here bypass the cache. Its<br>
>> not clear if path prefix matching is the best option for filtering out<br>
>> request that should bypass the cache. In working with app developers using<br>
>> Gears, the idea of specifying a particular query argument to filter on in<br>
>> addition to a path prefix has come up. <a href="http://server/pathprefix" target="_blank">http://server/pathprefix</a>   +<br>
>> &bypassAppCache<br>
>><br>
>> * opportunistic caching namespaces<br>
>> A mouthful but ok. Whatever terminology used for the category of resulting<br>
>> entries should be used here... perhaps 'auto-caching namespace'.<br>
>><br>
>> * fallback namespace [factored out of opportunistic-caching]<br>
>> This form of namespace is addressed by the spec at present, but is<br>
>> co-mingled with the auto-caching feature. This is a proposal to detangle<br>
>> them from one another. The basic idea is to load the resource as usual, and<br>
>> only upon failure fallback to a cached 'namespace-handler'... no<br>
>> auto-caching involved.<br>
>><br>
>> * intercept namespaces [new]<br>
>> This form of namespace is not in the spec at present. This is a proposal<br>
>> to add it. It is a heavily used feature of the Gears LocalServer. The basic<br>
>> idea is to intercept requests into this namespace and satisfy them with a<br>
>> cached 'namespace-handler'  without consulting the server.<br>
>><br>
>> summary of the above change requests<br>
>><br>
>> Cached resource categories (just name changes):<br>
>> * toplevel - pages which <html manifest='manifesturlforthisappcache'><br>
>> * manifest - the manifest file<br>
>> * explicit - explicitly listed in the manifest file<br>
>> * namespace-handler - resource which is utilized by a name-space<br>
>> * auto-cached - resources that have been cached via the auto-cache<br>
>> namespace<br>
>> * manually-cached - resources that have been cached via a javascript call<br>
>> to appCache.add()<br>
>><br>
>> Namespaces (name changes, refactored things a bit, and introduced the<br>
>> 'intercept' namespace)<br>
>> * bypass - bypasses further lookup within the appcache and resorts to the<br>
>> usual resource loading<br>
>> * intercept - doesn't hit server, serves a cached namespace-handler<br>
>> resource<br>
>> * autocache - hits server, caches successful response for future use, on<br>
>> server errors serves a cached namespace-handler resource<br>
>> * fallback - hits server, does NOT cache successful responses, on server<br>
>> errors serves a cached namespace-handler resource<br>
>><br>
>> Manifest file section headers:<br>
>> * BYPASS: list of url [namespaces/filters]<br>
>> * CACHE: list of exact [urls]<br>
>> * INTERCEPT: list of [urlnamespaces, namespace-handler url]<br>
>> * AUTOCACHE: list of [urlnamespaces, namespace-handler url]<br>
>> * FALLBACK: : list of [urlnamespaces, namespace-handler url]<br>
>><br>
>> Scriptlets - or dynamic namespace-handlers [new idea]<br>
>><br>
>> Something we wrestled with in the process of putting together the Gears<br>
>> LocalServer was the distinction between intercepting requests for urls and<br>
>> identifying the appropiate cached resource for that request. We ended up<br>
>> with a declarative manifest file, similar to but different from what is<br>
>> contained in this spec. This wasn't an altogether satisfying answer. The<br>
>> expressiveness of the language to match/filter requested urls is limited in<br>
>> Gears and this spec shares that same characterization.<br>
>><br>
>> Something else we've wrestled with in Gears was having to do awkward<br>
>> redesigns in corners of a web application in order to 'take it offline',<br>
>> single-sign-on for example. In general, anywhere an application relies on<br>
>> HTTP features more than HTML to influence navigation or conditional resource<br>
>> loading, it's difficult to address with a static cache.<br>
>><br>
>> So I'd like to propose extending this spec to incorporate 'dynamically<br>
>> generated responses'. I think this capability fits into this corner of the<br>
>> HTML5 spec because this is most directly useful in the "Offline Web<br>
>> Application" scenario. The basic idea is to execute application code<br>
>> (script) to produce responses to intercepted resource loads. The application<br>
>> code is executed in the background and can formulate a response<br>
>> asynchronously.<br>
>><br>
>> Some handwaving where this could hang off of this spec<br>
>> * Modify namespace-handlers entries to have an attitional attribute to<br>
>> indicate that they are to be executed rather than returned<br>
>><br>
>> And some handwaving at what a scriptlet can do...<br>
>> * Can read the request headers and POST body<br>
>> * Can set response status code and headers (redirects)<br>
>> * Can generate a textual response body<br>
>> * Can designate a non-executable cached resource to be returned in<br>
>> response<br>
>> * Can decide to 'bypass' handling of a request and defer to the usual<br>
>> resource loading<br>
>> * Can decide to perform the usual resource loading, but to have the<br>
>> response added to the appCache<br>
>> * Can access HTML5Database APIs<br>
>> * Can utlize XmlHttpRequest to communicate with a server<br>
>><br>
>> This would obviously be significant addition to the spec, but i do think<br>
>> this is worth consideration in the context of 'offline applications'. Based<br>
>> on observations of app developers wrestling with Gears, there have been<br>
>> several pain points. The HTML5ApplicationCache addresses one of them<br>
>> with per-application caches. This addition would address the second of<br>
>> them.  (Another pain point has been application deployment).<br>
>><br>
>> Am interested in seeing what others think of an addition along these<br>
>> lines.<br>
><br>
><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]<br>

</div>