Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Efficiently wipe disk cache when many items are too old #186

Open
bkase opened this issue Apr 10, 2017 · 0 comments
Open

Efficiently wipe disk cache when many items are too old #186

bkase opened this issue Apr 10, 2017 · 0 comments

Comments

@bkase
Copy link
Contributor

bkase commented Apr 10, 2017

Cache clearing via the ageLimit can be too slow when too many items expire all at once. This can hurt app-startup performance. As far as I understand it, this is slow because we check file timestamps and remove files one at a time. Removing directories is faster than removing files so if there were some way that the disk cache could optimize this to remove directories.

Random ideas:

  1. Persist the "oldest" timestamp and do a quick check in the beginning to just wipe the full directory. Downside: Must wipe entire cache.

  2. Add layer(s) of inner directories grouped by some time interval. Then we can wipe huge chunks of the cache efficiently. The semantics of how this could work exactly need more looking into. Downside: Invalidates caches for existing users, and is complex.

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

No branches or pull requests

2 participants