mod_tile
mod_tile copied to clipboard
Limit total size of cached tiles
Is it possible to limit the total size of cached files to say 512MB and then delete tiles based on last accessed timestamps when space is needed?
@trohsb If you're trying to do something like that, https://github.com/SomeoneElseOSM/mod_tile/blob/zoom/purge_old_tiles.sh might be a useful example to start from. See also https://github.com/SomeoneElseOSM/mod_tile/blob/zoom/report_tile_size.sh and https://github.com/SomeoneElseOSM/mod_tile/blob/zoom/report_database_size.sh . Each of those may need modifying to match your tile location. database location and mod_tile version of course.
There are so many useful scripts around mod_tile. Wondering if at some point it would make sense to put them all together in a helper program with command-line arguments :thinking:
For now, @SomeoneElseOSM, do you think it would make sense to add these scripts to the utils
directory and make them available here?
do you think it would make sense to add these scripts to the utils directory and make them available here?
Yes - but you'd ned to make sure that https://github.com/SomeoneElseOSM/mod_tile/blob/zoom/purge_old_tiles.sh was using the standard mod_tiles's "long time ago" (20 years) as opposed to mine (10k days, which I chose because it's more visible when you're looking at dates on disk)