Firefox caches JavaScript variables
It seems that Firefox (since 1.5) tries to cache not only the contents of a page, but JavaScript variables as well with something called bfcache. This also means that, among other things, the onload event will not fire if the user uses the Back button, or that variables set on the page will not be re-set and global scripts are not executed again. This can be important in AJAX-based applications, or if one tries to implement an analytics system on the page.
Apparently, defining an onunload event handler prevents Firefox from doing this kind of caching.
Apparently, defining an onunload event handler prevents Firefox from doing this kind of caching.