Skip to content

Implement better file cache management with size limits and expiratio…#66

Open
Titi211179 wants to merge 1 commit intoNeuralEnsemble:masterfrom
Titi211179:fix/cache-management
Open

Implement better file cache management with size limits and expiratio…#66
Titi211179 wants to merge 1 commit intoNeuralEnsemble:masterfrom
Titi211179:fix/cache-management

Conversation

@Titi211179
Copy link

Fixes #34

This PR adds cache management to the downloaded file cache:

  • Size limit: configurable maximum cache size (default 10 GB),
    removing least recently accessed files when exceeded
  • Expiration: files older than a configurable period (default 30 days)
    are automatically re-downloaded
  • JSON index: tracks download date, last access time and file size
    for each cached file
  • Automatic cleanup: runs before each download, removing expired
    files and enforcing size limits
  • Empty directory cleanup: removes leftover empty subdirectories

Settings are configurable via environment variables:

  • CACHE_MAX_SIZE_GB (default: 10)
  • CACHE_FILE_EXPIRY_DAYS (default: 30)

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.

Implement better management of downloaded files cache

1 participant