Putting the current discussion of the issues with AppCache aside for a couple of minutes, there is no provision in HTML5 History to include pages "pushStated" into the current App Cache Group
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.
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 the Cache.
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.
I am interested to hear your thoughts.
I lead the Chrome Developer Relations team at Google.
We want people to have the best experience possible on the web without having to install a native app or produce content in a walled garden.
Our team tries to make it easier for developers to build on the web by supporting every Chrome release, creating great content to support developers on web.dev, contributing to MDN, helping to improve browser compatibility, and some of the best developer tools like Lighthouse, Workbox, Squoosh to name just a few.