Opened 13 years ago

Closed 13 years ago

#8527 closed enhancement (duplicate)

the default registration of on*unload handlers breaks fastback caches

Reported by: alex Owned by: alex
Priority: high Milestone: 1.3
Component: Core Version: 1.2.3
Keywords: onunload, cache, fastback, addOnUnload Cc: James Burke, phiggins, wildbill, bill
Blocked By: Blocking:


On browsers that support "fast-back" (Safari, Firefox, etc.), Dojo's registration of a default handler on the beforeunload and unload events totally destorys the ability of dojo-using pages to be considered for this caching scheme, slowing down these pages for many users.

The proposed solution, as discussed with jburke and phiggins, is to only add the handler to the window object upon the first call to addOnUnload or addOnBeforeunload. This may affect behavior on pages which employ this pattern today:

dojo.connect(dojo, "unloaded", function(){ ... });

but which do not at any point call:


For these pages, the unloaded call will not happen since the window-level registration will not occur. Several strategies for handling this can be imagined, but none of them prevent the basic issue that some listeners to dojo.unloaded may not be called.

This is mitigated by noting that:

  • no dojo code actually does this
  • we will document the change in behavior
  • that no browser for which fast-back caching is available also requires any default cleanup

Closing this bug requires:

Change History (1)

comment:1 Changed 13 years ago by alex

Resolution: duplicate
Status: newclosed

ugg, trac filed dupes since I thought it wasn't being responsive. See [8526] instead.

Note: See TracTickets for help on using tickets.