Add Cache-Control header to your Sinatra static assets
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
.gitignore
Gemfile
Gemfile.lock
README.md
sinatra-cache-assets.gemspec

README.md

Sinatra::CacheAssets

This Rack middleware will add a Cache-Control header to your Sinatra static assets

Usage

require "sinatra"
require "sinatra/cache_assets"

use Sinatra::CacheAssets, :max_age => 7200  # seconds, defaults to 86400

get "/" do
  "some data"
end

License

MIT