Skip to content

feat: update game cache per file instead of full re-download - #121

Merged
Tchips46 merged 1 commit into
mainfrom
feat/dynamic-cache-update
Oct 23, 2026
Merged

Tchips46 merged 1 commit into
mainfrom
feat/dynamic-cache-update

Conversation

@Tchips46

Copy link
Copy Markdown
Member

Resolves #8

Problem

Cache all-or-nothing. One file change → wipe OPFS, download whole game. Cached files never checked.

Fix

  • client: manifest files = { path, hash, size }. SHA-256, memo by size+mtime → no rehash each request.
  • client: manifest built per request. Old shared MANIFEST.files race gave partial lists → with diff would delete cached files.
  • website: local path → hash index in localStorage. Diff vs manifest:
    • new/changed → download
    • same hash + same size → reuse
    • gone → delete from OPFS
  • index written after file fully written → interrupted update resumes.
  • no index (force / first load / old loader cache) → clear all, full download.
  • loading UI: Download i / N, N = outdated only.
  • drop isManifestUpToDate + version/ (unused now). client still sends version.

client: manifest files carry sha256 hash + size, hashes memoized by size+mtime,
manifest built per request (no shared list race).
website: diff local hash index vs manifest, download new/changed, delete removed,
reuse only when hash and size match.

Closes #8
@Tchips46 Tchips46 self-assigned this Oct 23, 2026
@Tchips46
Tchips46 requested a review from Exeloo as a code owner October 23, 2026 14:26
@github-actions github-actions Bot added app:client Related to client app app:website Related to website app labels Oct 23, 2026
@Tchips46
Tchips46 merged commit db7baf7 into main Oct 23, 2026
3 checks passed
@Tchips46
Tchips46 deleted the feat/dynamic-cache-update branch October 23, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:client Related to client app app:website Related to website app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic cache update

2 participants