We currently register objects when there are clients asking for cached items or connect event listeners. We could unregister the objects and clear the cache if all the clients are disconnected.
Created attachment 448152 [details] Patch
Created attachment 449047 [details] Patch
Committed r288013 (?): <https://commits.webkit.org/r288013>