The gem documentation doesn't provide any information about the caching mechanism, but looking in the source code tells that they're using the Rails.cache
so you can look at that.
Based on the error you gave, your Rails application seem to use the :file_store
cache (it's the default one), and the Rails documentation says:
As the cache will grow until the disk is full, it is recommended to periodically clear out old entries.
But I found a cleanup
method which is present since a while (I checked from Rails version 3 to 6) and seem to know about expired data, but there were a bug preventing Rails to clean expired data that has been fixed in Rails 5.2. If you're using Rails 5.2 and newer try to set an expiration time to the cache:
config.cache_store = :file_store, Rails.root.join('tmp', 'cache'), { expires_in: 10.minutes }
Please update the cache path (second argument) and the adapt the expires_in
value for your case.
Another option would be to change the Rails cache store to something like Redis (using the redis-rails gem) or Memcached.
Redis will delete the expired keys and Memcached delete the oldest keys when reaching the limit of allowed space.