Skip to content

Improve cache management (issue #8)#33

Merged
virtualian merged 1 commit into
mainfrom
8-cache-management
Dec 7, 2025
Merged

Improve cache management (issue #8)#33
virtualian merged 1 commit into
mainfrom
8-cache-management

Conversation

@virtualian

Copy link
Copy Markdown
Owner

Summary

  • Move cache to ~/.npm-scanner/ (persistent across reboots)
  • Add 200MB size limit with automatic eviction of oldest files
  • Change expiration from 24h to 3 days
  • Minimize cached data to only needed fields (~97% smaller: 600 bytes vs 17KB)
  • Add package list cache for faster counting (mtime invalidation)
  • Add npm-scanner.sh cache command (--status, --clear, --clear-expired)
  • Display cache stats after scans

Test plan

  • Cache invalidation when node_modules changes
  • Scoped packages (@scope/pkg) handled correctly
  • Size limit eviction removes oldest files
  • 3-day expiration logic works
  • --clear-expired command works
  • Multiple node_modules directories cached separately
  • Cross-platform stat commands (macOS/Linux fallback)
  • End-to-end performance (~14x faster counting on cached runs)

Closes #8

- Move cache to ~/.npm-scanner/ (persistent across reboots)
- Add 200MB size limit with automatic eviction of oldest files
- Change expiration from 24h to 3 days
- Minimize cached data to only needed fields (~97% smaller)
- Add package list cache for faster counting (mtime invalidation)
- Add `npm-scanner.sh cache` command (--status, --clear, --clear-expired)
- Display cache stats after scans
@virtualian virtualian merged commit ae6fc5d into main Dec 7, 2025
1 check passed
@virtualian virtualian deleted the 8-cache-management branch December 8, 2025 22:16
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.

Redesign output and cache management

1 participant