introduce rack:cache as a default, so users don't need to configure apache or nginx

under rack cache we are able to serve 620reqs a second per thin (on my machine) before it 12 (on my machine)

reorganised so mini profilers can be cleanly disabled from config file

added caching for categories index

move production.rb to production.sample.rb
This commit is contained in:
Sam
2013-04-11 16:24:08 +10:00
parent edd25e01a8
commit 850b042cab
16 changed files with 100 additions and 64 deletions

View File

@ -1,5 +1,11 @@
module CurrentUser
def self.has_auth_cookie?(env)
request = Rack::Request.new(env)
cookie = request.cookies["_t"]
!cookie.nil? && cookie.length == 32
end
def self.lookup_from_env(env)
request = Rack::Request.new(env)
lookup_from_auth_token(request.cookies["_t"])