module

Marten::CDNCache::Cacheable

Handler concern: opt a handler INTO a public cache policy.

class BlogIndex < Marten::Handler
  include Marten::CDNCache::Cacheable
  cacheable Marten::CDNCache::Policy.public_cached(max_age: 300, s_maxage: 86_400)
end

On after_dispatch it stores the selected policy in an internal response header that Marten::CDNCache::Middleware reads (and deletes) on the way out.

Nested types