0.0
No commit activity in last 3 years
No release in over 3 years
Easily set up a cache-clearing endpoint for your Rails app.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

~> 4.0
 Project Readme

CacheClear

Gem Version Travis Status

CacheClear is a simple pre-built solution for adding a cache-clearing endpoint to your Rails app.

Just send a DELETE request to /cache_clear and the Rails cache will be cleared. No need to enter the Rails console!

You can (and should!) configure CacheClear to use an authorization token, to make sure no evil would-be DDoSers crash your app by continuously emptying the caches.

CacheClear is great as a way for scripts (e.g. hubot) to clear caches remotely without needing to directly touch your production servers.

How to include CacheClear in your project

  1. Add it to your gemfile:
gem 'cache_clear'
  1. Mount it in config/routes.rb:
YourApp::Application.routes.draw do
  mount CacheClear::Engine => "/cache_clear" # or a route of your choosing
  # the rest of your file
end
  1. Optional but strongly recommended: Set up authentication in an initializer (e.g., config/initializers/cache_clear.rb):
CacheClear.configure do |config|
  config.auth_token = "super_secure_string"
end

...and you're good to go!

License

This project uses the MIT-LICENSE.