Skip to content

Conversation

@xammen
Copy link

@xammen xammen commented Jan 4, 2026

Summary

  • Fixes slow startup (~21 seconds) caused by reinstalling plugins on every launch
  • When plugins use @latest, the cache now tracks timestamps and reuses cached versions for 24 hours
  • Reduces plugin loading time from ~21s to <1s

Problem

The cache check compared 'latest' against the resolved version (e.g., '2.12.2'), which never matched:

if (parsed.dependencies[pkg] === version) return mod  // 'latest' !== '2.12.2'

Solution

  • Added _timestamps field to track when packages were installed
  • For @latest requests, reuse cached version if installed within 24 hours
  • Still allows periodic updates while avoiding redundant reinstalls

…ry startup

When plugins use @latest version, the cache check compared 'latest' against
the resolved version (e.g., '2.12.2'), which never matched, causing a full
reinstall of all plugins on every startup (~20+ seconds).

This fix:
- Adds timestamp tracking for cached packages
- For @latest requests, reuses cached version if installed within 24 hours
- Resolves and stores the actual version after installation

Reduces startup time from ~21s to <1s for plugin loading.
@xammen xammen changed the title fix(bun): cache plugin versions with TTL to avoid reinstalling on every startup perf(bun): cache plugin versions with TTL to avoid reinstalling on every startup Jan 4, 2026
@rekram1-node
Copy link
Collaborator

this doesnt seem like a good solution, if this is the issue:

The cache check compared 'latest' against the resolved version (e.g., '2.12.2'), which never matched:

if (parsed.dependencies[pkg] === version) return mod  // 'latest' !== '2.12.2'

Why not just compare to the actual version that we have installed as a fix then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants