I have some custom middleware that is include at the top of my stack and what i need to do in it is access the rails cache. How can I load/access the rails cache from the middleware without having to load the whole rails app up first?
How to access rails cache inside rack middlware
263 views Asked by Jake McAllister At
2
Rails on Rack Rails Application's Rack Object
ApplicationName::Application is the primary Rack application object of a Rails application. Any Rack compliant web server should be using
ApplicationName::Application object
to serve a Rails application. Rails.application refers to the same application object. rails serverrails server does the basic job of creating a Rack::Server object and starting the webserver.
Here's how rails server creates an instance of Rack::Server
The Rails::Server inherits from Rack::Server and calls the Rack::Server#start method this way:
Here's how it loads the middlewares:
courtsy : http://guides.rubyonrails.org/rails_on_rack.html and also u can follow : https://devcenter.heroku.com/articles/rack-cache-memcached-rails31