Re: App Cache and History API

On Tue, 17 May 2011, Paul Kinlan wrote:
>
> Consider this flow.  We have a multi paged app with pages A and B when 
> rendered from the server sharing the same AppCache and thus in the same 
> group.
> 
>    - User visits page A, it uses an app cache, so everything is cached.
>    - User navigates from A to B, page B is added to the app cache group.
>    - User goes offline
>    - User refreshes A it is served from the Cache,  User refreshes B, it is
>    served from the Cache.
> 
> Update the AppCache, A and B are re-downloaded and cached.

(Which is what you want, since they are generated server-side.)

> Now if we inject HTML5 History for the same flow:
> 
>    - User visits page A, it uses an app cache, so everything is cached.
>    - User navigates from A to B (via pushState) .....  currently B is not
>    added to the App Cache group.
>    - User goes offline
>    - User refreshes A it is served from the Cache,  User refreshes B, fail,
>    because not in Cache.
> 
> I believe that as URL's change if the master page is app cached, those 
> pages should be added to the App Cache group.

Nah, in this case, there should just be one client-side page for all the 
(potentially infinite) URLs, since that page can generate the others. For 
this use case, we have the "fallback" feature. You'd specify one page, 
which knows how to build all the others, and make it the fallback for all 
the others.


> Death by App Cache: The problem that we also faced was as master entries 
> are added to an App Cache group, when an update to the App Cache occurs, 
> all those pages in the App Cache are refreshed, with more dynamic 
> applications this could mean that 10's or 100's of pages are quickly 
> downloaded by the App Cache software and thus can quickly cause a mini 
> DDOS.

Yeah, that's a problem. Any suggestions for fixing this?

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

Received on Monday, 1 August 2011 22:33:08 UTC