Skip to content

Commit b0a7068

Browse files
committed
Merge pull request #7833 from frodsan/extract_ap_pages_actions_caching
Extract AP Page and Action caching from Rails
2 parents 7d204ed + ea042ba commit b0a7068

File tree

8 files changed

+65
-1138
lines changed

8 files changed

+65
-1138
lines changed

actionpack/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
## Rails 4.0.0 (unreleased) ##
22

3+
* `ActionController::Base.page_cache_extension` option is deprecated
4+
in favour of `ActionController::Base.default_static_extension`.
5+
6+
*Francesco Rodriguez*
7+
8+
* Action and Page caching has been extracted from Action Dispatch
9+
as `actionpack-action_caching` and `actionpack-page_caching` gems.
10+
Please read the `README.md` file on both gems for the usage.
11+
12+
*Francesco Rodriguez*
13+
314
* Failsafe exception returns text/plain. *Steve Klabnik*
415

516
* Remove actionpack's rack-cache dependency and declare the

actionpack/lib/action_controller/caching.rb

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
require 'uri'
33
require 'set'
44

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

3431
eager_autoload do
35-
autoload :Actions
3632
autoload :Fragments
37-
autoload :Pages
3833
autoload :Sweeper, 'action_controller/caching/sweeping'
3934
autoload :Sweeping, 'action_controller/caching/sweeping'
4035
end
@@ -58,12 +53,25 @@ def cache_configured?
5853
include AbstractController::Callbacks
5954

6055
include ConfigMethods
61-
include Pages, Actions, Fragments
56+
include Fragments
6257
include Sweeping if defined?(ActiveRecord)
6358

6459
included do
6560
extend ConfigMethods
6661

62+
config_accessor :default_static_extension
63+
self.default_static_extension ||= '.html'
64+
65+
def self.page_cache_extension=(extension)
66+
ActiveSupport::Deprecation.deprecation_warning(:page_cache_extension, :default_static_extension)
67+
self.default_static_extension = extension
68+
end
69+
70+
def self.page_cache_extension
71+
ActiveSupport::Deprecation.deprecation_warning(:page_cache_extension, :default_static_extension)
72+
default_static_extension
73+
end
74+
6775
config_accessor :perform_caching
6876
self.perform_caching = true if perform_caching.nil?
6977
end

actionpack/lib/action_controller/caching/actions.rb

Lines changed: 0 additions & 189 deletions
This file was deleted.

0 commit comments

Comments
 (0)