Use redis as a cache store
This commit is contained in:
@@ -4,7 +4,10 @@ module Main
|
||||
class Index < Action
|
||||
include Deps["views.posts.index"]
|
||||
def handle(req, res)
|
||||
res.render index, query: req.params[:q]
|
||||
res.body = cache(key: "posts_index",
|
||||
params: [req.params[:q]],
|
||||
content_proc: ->(q) { res.render index, query: q })
|
||||
res.status = 200
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user