Giter Site home page Giter Site logo

mdx-dev / cache_clear Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amcaplan/cache_clear

0.0 9.0 0.0 25 KB

Easily set up a cache-clearing endpoint for your Rails app.

License: MIT License

Ruby 79.37% JavaScript 2.29% CSS 2.09% HTML 16.25%

cache_clear's Introduction

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.

cache_clear's People

Contributors

mrchucho avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.