With CKAN, a new Beaker session is saved with each page load, AJAX request, and Flash message popup.
Is it really necessary to save so many sessions. Forgive my ignorance but I don't think I fully understand the benefit especially as it steadily fills the cache directory with many small files.
Is there any downside to periodically clearing out the directory?
CKAN does not manage the beaker session files, you can find more info on this related issue https://github.com/ckan/ckan/issues/5294, where sessions are saved on db rather than on filesystem.
I added a line like this in my crontab file, to remove session files older than 24 hours: