Skip to content
Browse files
Merge pull request #7833 from frodsan/extract_ap_pages_actions_caching
Extract AP Page and Action caching from Rails
  • Loading branch information
rafaelfranca committed Oct 4, 2012
2 parents 7d204ed + ea042ba commit b0a7068564f0c95e7ef28fc39d0335ed17d93e90
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 1,138 deletions.
@@ -1,5 +1,16 @@
## Rails 4.0.0 (unreleased) ##

* `ActionController::Base.page_cache_extension` option is deprecated
in favour of `ActionController::Base.default_static_extension`.

*Francesco Rodriguez*

* Action and Page caching has been extracted from Action Dispatch
as `actionpack-action_caching` and `actionpack-page_caching` gems.
Please read the `` file on both gems for the usage.

*Francesco Rodriguez*

* Failsafe exception returns text/plain. *Steve Klabnik*

* Remove actionpack's rack-cache dependency and declare the
@@ -2,11 +2,9 @@
require 'uri'
require 'set'

module ActionController #:nodoc:
module ActionController
# \Caching is a cheap way of speeding up slow applications by keeping the result of
# calculations, renderings, and database calls around for subsequent requests.
# Action Controller affords you three approaches in varying levels of granularity:
# Page, Action, Fragment.
# You can read more about each approach and the sweeping assistance by clicking the
# modules below.
@@ -17,8 +15,7 @@ module ActionController #:nodoc:
# == \Caching stores
# All the caching stores from ActiveSupport::Cache are available to be used as backends
# for Action Controller caching. This setting only affects action and fragment caching
# as page caching is always written to disk.
# for Action Controller caching.
# Configuration examples (MemoryStore is the default):
@@ -32,9 +29,7 @@ module Caching
extend ActiveSupport::Autoload

eager_autoload do
autoload :Actions
autoload :Fragments
autoload :Pages
autoload :Sweeper, 'action_controller/caching/sweeping'
autoload :Sweeping, 'action_controller/caching/sweeping'
@@ -58,12 +53,25 @@ def cache_configured?
include AbstractController::Callbacks

include ConfigMethods
include Pages, Actions, Fragments
include Fragments
include Sweeping if defined?(ActiveRecord)

included do
extend ConfigMethods

config_accessor :default_static_extension
self.default_static_extension ||= '.html'

def self.page_cache_extension=(extension)
ActiveSupport::Deprecation.deprecation_warning(:page_cache_extension, :default_static_extension)
self.default_static_extension = extension

def self.page_cache_extension
ActiveSupport::Deprecation.deprecation_warning(:page_cache_extension, :default_static_extension)

config_accessor :perform_caching
self.perform_caching = true if perform_caching.nil?

This file was deleted.

0 comments on commit b0a7068

Please sign in to comment.