Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 24 lines (22 sloc) 0.651 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
module ActionController
  module Caching
    module Pages
      module ClassMethods
        def expire_page(path)
          # NOOP
        end

        def cache_page(content, path)
          # NOOP
        end

        def caches_page(*actions)
          return unless perform_caching
          options = actions.respond_to?(:extract_options!) ? actions.extract_options! : {}
          after_filter({:only => actions}.merge(options)) do |c|
            c.response.headers['Cache-Control'] = 'public, max-age=300'
            c.response.headers.delete('cookie') # caching the page means no cookies
          end
        end
      end
    end
  end
end
Something went wrong with that request. Please try again.