Skip to content

[perf] Share cache manager and add global cache for useAllAssets #29179

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

Closed
wants to merge 1 commit into from

Conversation

salazarm
Copy link
Contributor

Summary & Motivation

Currently when there are multiple useAllAssets hooks on the page they each end up handling indexeddb separately because they create separate cache managers. To fix this make getCacheManager the only way to obtain one so that we reuse them and don't pull from indexeddb multiple times.

Secondly add a global in memory cache to make sure we're not fetching more than once and not fetching too often. This is a stop-gap for now, long term we're going to get rid of this logic and fold everything into a generalized WorkspaceContext abstraction.

How I Tested These Changes

Use the app and everything works. Foregoing complicated testing for now since we will be folding this into the WorkspaceContext soon.

@salazarm salazarm requested review from bengotow and hellendag April 10, 2025 17:11
Copy link

github-actions bot commented Apr 10, 2025

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-bym6ans38-elementl.vercel.app
https://salazarm-assets-perf.core-storybook.dagster-docs.io

Built with commit b57bf66.
This pull request is being automatically deployed with vercel-action

share cache manager

share cache manager

share cache manager

share cache manager

share cache manager
@salazarm salazarm force-pushed the salazarm/assets-perf branch from b2050eb to b57bf66 Compare April 10, 2025 17:39
@salazarm
Copy link
Contributor Author

included in #29151

@salazarm salazarm closed this Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant