views:

23

answers:

1

Hi - I have some questions about usage of HTML5 Cache, hopefully someone can provide some help.

I have a web app where a user can query info about reservations they have made. I'd like to use the HTML5 Cache so that when a user queries a reservation, the results page will be cached offline. I want this so the user can quickly view the reservation info in future without having to be online.

Looking at the docs on HTML5 Cache, I'm not sure if this is possible because you need to explicitly list each page cached. In my case, the same page URL will be cached, but with different content per reservation. e.g. results.html

Is it possible to list wildcards for the pages to be cached, so I can specify something like

results?resID=***

So all results page, with the Reservation ID to distinguish them, are cached.

And a follow up to this, is there any way to query using javascript what pages are cached ?

Has anyone had any success trying the same thing ?

A: 

I think you might be better off specifying the base page to be cached but then populating the reservations with JavaScript, then use localStorage to store the results. When the user accesses the base page offline then you can load in the correct values from localStorage.

robertc
Yeah, I think you're right, my original approach would only end in tears.
Kevin