LoginSignup
0
0

More than 5 years have passed since last update.

Lokka(Sinatra app)でhttp headerのキャッシュ制御

Posted at

Lokkaをherokuで動かしていたが高速化をしたかったのでcloudfrontに置いたら、キャッシュ制御が必要になった。

Lokkaはsinatraベースなので下記リファレンスに従えばいい
http://www.sinatrarb.com/intro#Cache%20Control

今回はLokka::Blogというプラグインを用意してそこでafter filterに登録した。

module Lokka
   module Blog
     def self.registered(app)
       app.after do
          cache_control :public, :must_revalidate, :max_age => 600
        end
   end
  end
end
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0