[whatwg] Offline Web Apps

On Sep 13, 2007 1:59 PM, Ian Hickson <ian at hixie.ch> wrote:
> Ok, but what are you proposing to _solve_ this? There's no difference
> between the following two models as I see it:
>
>   * Download an HTML page for each bug
>
>   * Download a single page to generate the bug pages plus one data
>     page per bug

By 'data page' you mean a row of data representing that page? I
presume that downloading a single row of data will be more efficient
than downloading an entire web page plus rechecking all its resources.

It also has the advantage of not making update take as long as
refetching a resource from the server for every possible bug.

> ...except that the former will mean there's no difference between online
> and offline, and the latter will mean there _is_ a difference between
> online and offline, which will bring in its associated sets of bugs.
>
> I don't understand how you would expect the client-side server idea (the
> parsing of server-side URIs on the client) to work. It would be helpful to
> see actual sample code, maybe.

Most AJAX libraries already have code to parse querystrings. It comes
up a lot and it isn't that hard:

http://trac.mochikit.com/browser/mochikit/trunk/MochiKit/Base.js#L1140

Basically, what I'm saying is that an application like Bugzilla has
thousands of possible entry points. These URLs are spread all over the
web and they should continue to work with the offline-enabled version
of Bugzilla. I don't see any way to make this possible efficiently
other than having something like the ability to ignore querystrings.

Something to do more flexible matching would be better, but we thought
this was a good happy medium for gears.

Maybe you were asking how you could keep querystring-based urls in the
offline version of Bugzilla? One option would be to go ahead and keep
using them. In the offline version you could do:

function gotoBug(bugId) {
  location.href = "?b=" + bugId;
}

This would cause a refresh, but since the page is captured and ignores
querystrings, it is fast.

In your initialization you have something like:

window.onload = function() {
  var bugData = db.execute("select * from bugs where id = ?",
parseQueryString()["b"]);
}

- a

Received on Thursday, 13 September 2007 15:00:05 UTC