-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexedDB Tile Cache #6720
IndexedDB Tile Cache #6720
Conversation
Updates based on your feedback. I believe the IDBStorage class should now be testable on its own, so I'm working on getting that going. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good progress, but we're still not there 😉
As I commented below, I'd suggest branching this branch and see how it looks when removing the new channel.
It won't take you long, and then we can discuss it further, I think it is worth a try.
IDBTileRequestChannel has now been fully removed, IDBStorage has been renamed to IndexedDBCacheManager (copilot's suggestion). The interface IndexedDBCache has been created with a fetch function, and IndexedDBCacheManager and IndexedDBCachePassThrough implement the interface. Within IndexedDBCacheManager, all functions except for the fetch function have been made private. Within BatchedTiles.ts, the IDBTileRequestChannel has been replaced with _localCache, an instance of IndexedDBCacheManager. |
It looks way better! All changes are good.
|
Co-authored-by: danieliborra <107669762+danieliborra@users.noreply.github.com>
Updates from most recent commit:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract-api
Taken care of. |
is extract-api failing again? |
Yeah it is, not sure why. I re-ran it and re-committed everything applicable with my latest commit, but it doesn’t seem to be working. Looking into that this morning |
All good. Approving |
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
Force-merging because unrelated failing reality data integration test. |
Create a local cache with IndexedDB which will be used to store tiles from the mesh export service. The IndexedDBCache class is a standalone class which interfaces with IndexedDB and can be used widely. The class can store, delete, and retrieve content from an IndexedDB database, and has the option to have the content in the database expire.
If the useIndexedDBCache conditional is set true, tiles being fetched through the itwinjs-batched-models channel will first attempt to fetch their content from an IndexedDB database. If that content cannot be found or is expired, the channel will fetch the content normally and store the content for future requests.