Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Caching Binaries #10

Open
TurtleP opened this issue Nov 2, 2023 · 0 comments
Open

Caching Binaries #10

TurtleP opened this issue Nov 2, 2023 · 0 comments

Comments

@TurtleP
Copy link
Collaborator

TurtleP commented Nov 2, 2023

Summary

The client should cache the compiled binaries from the sha256 of icon + toml file. This file rarely changes and would be a good way to store a Record<sha256, Record<extension, binaryData>.

On the first run, we get the sha256 and store it in localStorage. Then each binary that was compiled is stored into cachedBinaries, where the sha256 is the key and value is one of the targets, whose value is the base64 encoded binary data we compiled. We could expand upon this and add converted assets as well, so that those do not need to be re-converted.

Example:

cachedBinaries: {
  "1279mdfas9124vbjladf82": {
    "ctr":"<base64 of the .3dsx>",
    "hac":"<base64 of the .nro>",
    "cafe":"<base64 of the .wuhb>"
  }
}

The second run will find the sha256 as needed, pull the binary from the cache if found (and add both old and new converted assets on 3DS) and bundle it as needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant