Very nice job on rompr, works like a charm. Just wondering: Is there any way to limit or disable image caching?
I'm pushing the limits a bit, installing an os and rompr on a 1GB drive in a (very) old computer. Everything fits, and I have 28MB free space left (music is located on a network share). Whenever I listen to the radio, the prefs/imagecache folder keeps on filling up and as a result I run out of diskspace, which crashes rompr's playlist. I can set up a cron clean script to remove everything in this folder, along with the USERSTREAM... files, but that seems a bit barbaric.
Is there a clean way to disable or limit image caching in Rompr?
Cheers,
Maarten
Last edit: Maarten Dirickx 2017-01-31
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've got to admit that rompr's cache is a little bit simplistic, but a cache is necessary as most of the information sources I use (last.fm, musicbrainz, etc) will ban rompr from the API if I hammer them too hard.
Every time you refresh the page rompr runs
rompr/utils/cleancache.php
which goes through the cache directories removing files older than a certain age - currenty 15 days for imagecache. You can modify the time value in cleancache.php, but this won't do anything while radio is playing, only when you refresh the page. Your cron script sounds like the best solution if you need to monitor that directory transparently. You can mess around with the imagecache all you like, that's not Barbaric :) but removing the USERSTREAM files is not a good idea (they are required by the playlist and they get removed when you clear the playlist).
Please note that messing about with any of the timeouts on the jsoncache directories will likely result in getting rompr banned from those APIs so please don't modify those.
clean_cache_dir('prefs/imagecache/', 1296000);
The number is the maximum file age in seconds.
One "less barbaric" thing you could try doing is to set the maximum image file age to an hour or so and then use your cron script to retrieve cleancache.php using cUrl This would perhaps keep the cache at a reasonable size
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi guys,
Very nice job on rompr, works like a charm. Just wondering: Is there any way to limit or disable image caching?
I'm pushing the limits a bit, installing an os and rompr on a 1GB drive in a (very) old computer. Everything fits, and I have 28MB free space left (music is located on a network share). Whenever I listen to the radio, the prefs/imagecache folder keeps on filling up and as a result I run out of diskspace, which crashes rompr's playlist. I can set up a cron clean script to remove everything in this folder, along with the USERSTREAM... files, but that seems a bit barbaric.
Is there a clean way to disable or limit image caching in Rompr?
Cheers,
Maarten
Last edit: Maarten Dirickx 2017-01-31
Hi, thanks for posting the question.
I've got to admit that rompr's cache is a little bit simplistic, but a cache is necessary as most of the information sources I use (last.fm, musicbrainz, etc) will ban rompr from the API if I hammer them too hard.
Every time you refresh the page rompr runs
which goes through the cache directories removing files older than a certain age - currenty 15 days for imagecache. You can modify the time value in cleancache.php, but this won't do anything while radio is playing, only when you refresh the page. Your cron script sounds like the best solution if you need to monitor that directory transparently. You can mess around with the imagecache all you like, that's not Barbaric :) but removing the USERSTREAM files is not a good idea (they are required by the playlist and they get removed when you clear the playlist).
Please note that messing about with any of the timeouts on the jsoncache directories will likely result in getting rompr banned from those APIs so please don't modify those.
The number is the maximum file age in seconds.
One "less barbaric" thing you could try doing is to set the maximum image file age to an hour or so and then use your cron script to retrieve cleancache.php using cUrl This would perhaps keep the cache at a reasonable size