Difference between rake tmp:clear and Rails.cache.clear

Sometimes I forget the difference between the functionality of this rake task and Rails method. This is a reference post I wanted to have that I hope you find helpful.

rake tmp:clear

This task only removes files from the Rails file system.


This will clear objects stored in the application cache, unless the value for `config.cache_store` for your application is set to `:file_store`. In the latter case `Rails.cache.clear` will be functionally the same as `rake tmp:clear`.

Post details source.