Skip to content

perf: preview cache optimizations - #3194

Merged
kulmann merged 5 commits into
mainfrom
perf/preview-cache-optimizations
Aug 25, 2026
Merged

perf: preview cache optimizations#3194
kulmann merged 5 commits into
mainfrom
perf/preview-cache-optimizations

Conversation

@JammingBen

@JammingBen JammingBen commented Aug 21, 2026

Copy link
Copy Markdown
Member
  • Revoke preview URLs when cache entries get evicted to ensure we don't keep any stale preview URLs for files that are long gone.
  • Introduce a byte limit to the preview cache, instead of a plain capacity limit. This makes more sense and generally increases the limit in file lists, which should improve performance in big file lists with lots of previews.
  • Calling get() and set() on the cache stops looping the entire cache to evict and instead does a lookup.

refs #3167

@JammingBen JammingBen self-assigned this Aug 21, 2026
@JammingBen
JammingBen marked this pull request as draft August 21, 2026 06:39
@JammingBen
JammingBen force-pushed the perf/preview-cache-optimizations branch from fdfd763 to 27ab340 Compare August 21, 2026 06:56
@JammingBen
JammingBen marked this pull request as ready for review August 21, 2026 09:20
Comment thread packages/web-pkg/src/composables/piniaStores/resources.ts Outdated
Comment thread packages/web-pkg/src/services/cache.ts
This ensures we don't keep any stale preview URLs for files that are
long gone.
The preview cache now has a byte limit instead of a plain capacity limit.
This makes more sense and generally increases the limit in file lists,
which should improve performance in big file lists with lots of previews.

Also, calling get() and set() on the cache stops looping the entire cache
to evict and instead does a lookup.
This way, we avoid conflicts between different fetched previews for the
same resource (e.g. preview in file list shouldn't mess with preview in
the right sidebar).
@JammingBen
JammingBen force-pushed the perf/preview-cache-optimizations branch from 27ab340 to ce4a3ac Compare August 24, 2026 14:30
@JammingBen
JammingBen requested a review from kulmann August 24, 2026 14:31
@JammingBen
JammingBen force-pushed the perf/preview-cache-optimizations branch from ce4a3ac to 8ba8d9b Compare August 24, 2026 14:46

@kulmann kulmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚤 🏇 🏎️

@kulmann
kulmann merged commit 8865bf7 into main Aug 25, 2026
31 checks passed
@kulmann
kulmann deleted the perf/preview-cache-optimizations branch August 25, 2026 06:11
@openclouders openclouders mentioned this pull request Aug 25, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants