[DataCache] Remove or Replace a Local Server Handler?

There is no way to remove a handler, or all handlers for a particular
namespace, after some have been registered. However, this may be a
valid design decision, because there probably aren't compelling use
cases for removing or replacing handlers. The only time I ran into
this need was running multiple tests in a single html file reusing
the same namespace (uri).

How about an application that wants to seamlessly update its offline
handlers without reloading the page? It would need to download a
script that removes the old handlers, and installs the new handlers.

Does this sound useful and practical?



As it stands right now, the Spec should be more specific about how
registerOfflineHandler handles multiple handlers registered on the
same namespace.

  var namespace = ...
  navigator.registerOfflineHandler(namespace, ..., ...); // 1st
  navigator.registerOfflineHandler(namespace, ..., ...); // 2nd

Possible scenarios:

  1. The 2nd replaces (and removes) the 1st.
  2. Both remain, the earliest registered handler is the final candidate
  3. Both remain, the latest registered handler is the final candidate
  4. A different heuristic.

I would prefer scenario #1. It doesn't make sense to have two different
handlers for the exact same namespace.  This also cuts down on potential
memory leaks, references to dead/unreachable code.

- Joe

Received on Thursday, 17 December 2009 05:31:45 UTC