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

flush/purge on disk cache #3

Open
ghost opened this issue Oct 7, 2013 · 3 comments
Open

flush/purge on disk cache #3

ghost opened this issue Oct 7, 2013 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 7, 2013

Consider an option to flush cache automatically/periodically. It may be also useful if it is not flushed at all or manually when going for long vacations or such.. so it should be just an option.

If flushed automatically it would be good to do it when connected to power.. might be in fact better trigger than automatic timer.

From the manual:


The variable diskCacheTruncateTime specifies the time for which an on-disk entry should remain unused before it is eligible for truncation; it defaults to 4 days and a half. The variable diskCacheTruncateSize specifies the size at which files are truncated after they have not been accessed for diskCacheTruncateTime; it defaults to 1MB. ```

hence for the beginning diskCacheUnlinkTime seems fine as is, while I do not like the truncate options - imho it is better to delete such files altogther. Therefore I always set diskCacheTruncateTime=diskCacheUnlinkTime+2 to leave them around until deleted.
@ghost
Copy link
Author

ghost commented Oct 7, 2013

the way to perform the purge btw is
$ kill -USR1 polipo-pid
$ sleep 1
$ polipo -x
$ kill -USR2 polipo-pid

@splondike
Copy link
Owner

I'm going to have to think a bit more about whether this should be manual, or automatic (with an off switch). Good idea though, my cache is currently ~700mb.

@ghost
Copy link
Author

ghost commented Oct 12, 2013

perhaps more than a simple on/off switch then? Also a gui switch to control the diskCacheUnlinkTime would be nice.

There is also "preciseExpiry" which should be set when underlying filesystem does not support file-access-time (sdcards)

As an alternative, the expiration could be coded in Java or shell. The polipo code to do it is somehow very slow and does not do several things that people often wanted - such as shrink to a certain disk usage. So many people have used custom scripts such as http://code.google.com/p/dolipo/source/browse/trunk/dolipo/polipo_trimcache-0.2.py

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

No branches or pull requests

1 participant