-
Notifications
You must be signed in to change notification settings - Fork 23
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
Cached not deleting. #35
Comments
Hi @jhemmmm, your code seems ok to me. Notice that at this moment We have not considered adding an automated cleanup of expired cache entries, but it sounds useful to have it when setting your cache directory. Something like cachedRequest.setCacheDirectory(cacheDirectory, {
cleanupInterval: 24 * 60 * 60 * 1000 // cleanup expired items every 24 hours
}); If you feel like wanting to contribute, feel free to open up a pull request. I would be happy to help you. |
I see, That might not be a good idea on my side. To Identify the expired cache entries, I have to load all saved json files on /tmp/cache. There's at least 2TB of files on my cache directory. |
I have tried added a queue job that delete the files base on it's ttl. It works perfectly fine. Thanks. EDIT: This thing requires redis. I am still looking for other solution. |
I have added a cleanup interval.
|
This looks way better without redis. Here are some comments:
Thank you for your ideas and contributions. Please keep them coming. |
I used age because the find+remove uses it to check the "creation" of the file. Instead of the ttl given by the cached-request. I'll take a look for it. |
Cached file does not seem to be deleting automatically. I am doing it wrong?.
The text was updated successfully, but these errors were encountered: