Enable Caching for Performance
A simple step to let elements cache some data.
We expose a function called initCachingLayer
that enables the caching mechanism used in elements to reduce loading times for chains and assets data. This significantly improves the user experience.
We will not clear any storage keys expect for the ones we create.
We have also shipped 3 different storage options that you can directly use!
AsyncIDBStorage - uses IndexedDB (persists between sessions)
AsyncLocalStorage - uses localStorage (persists between sessions)
AsyncMapStorage - use a javascript Map object (no persistence between sessions)
We recommend you to use AsyncIDBStorage
Apart from these three options, it accepts any async storage option that satisfies the following interface.
Last updated