Remove 'beforeunload' when the document unloads, to enabled caching