Made layout caches more robust, especially with the IndexedDB polyfill