Skip to content
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

Tips for improving perceived importance when loading large filesystem from IndexedDB? #17

Open
robert-westenberger opened this issue Aug 3, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@robert-westenberger
Copy link

Hi, I am using the IndexedDB backend in a very simple configuration:

import { configure } from "@zenfs/core";
import { IndexedDB } from '@zenfs/dom';

export async function createFilesystem() {
  await configure({
    mounts: {
      "/": {backend: IndexedDB, storeName: "foo", name: "foo"}
    }
  });
}

I call that createFilesystem function before I render my app. If I have a large amount of data stored in IndexedDB, when the page loads it might be several seconds before the filesystem is usable.

Is there any recommendation for improving "perceived" performance when loading the filesystem with a large amount of data?

When my app loads for the first time, I only need to access files in one specific directory... is there any way to load just those files and lazy load / stream the rest? Or something else?? Thank you

@james-pre
Copy link
Member

@robert-westenberger,

You can disable the preloading using disableAsyncCache. Please note that this will disable sync functions, but will also speed up loading times (perhaps down to only a few ms).

@james-pre james-pre added the question Further information is requested label Aug 4, 2024
@james-pre james-pre self-assigned this Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants