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

feat: wasm caching #78

Open
2 tasks
weboko opened this issue Oct 28, 2023 · 0 comments
Open
2 tasks

feat: wasm caching #78

weboko opened this issue Oct 28, 2023 · 0 comments
Labels
enhancement New feature or request track:rln RLN Track (Secure Messaging/Applied ZK), e.g. relay and applications

Comments

@weboko
Copy link
Contributor

weboko commented Oct 28, 2023

As of now .wasm files are retrieved by using fetch API which relies on server response whether to cache it and how long.

const response = await fetch(url);

const response = await fetch(url);

Problem with it that on simple or misconfigured servers it has no Cache policy and thus getting fetched always.
To fix it we should find a way to enforce caching.

First approach is to leverage IndexDB and put bytes into browser's memory with time-to-live restriction.
Dynamic import won't work here as it works only with ES modules.
LocalStorage cannot be used because of memory limitation.

Objectives

  • use IndexDB to save bytes of wasm;
  • investigate alternative approaches;
@weboko weboko added enhancement New feature or request track:rln RLN Track (Secure Messaging/Applied ZK), e.g. relay and applications labels Oct 28, 2023
@fryorcraken fryorcraken added this to Waku Oct 28, 2023
@weboko weboko moved this to To Do in Waku Oct 31, 2023
@chair28980 chair28980 moved this from To Do to Icebox in Waku Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request track:rln RLN Track (Secure Messaging/Applied ZK), e.g. relay and applications
Projects
Status: Icebox
Development

No branches or pull requests

1 participant