Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Set "SprocketsApplication.use_page_caching = false" to prevent the Sp…

…rocketsController#show concatenation from being written to disk when config.action_controller.perform_caching is true
  • Loading branch information...
commit 8be0fff7a1f702dbd572c876636796693c79bc7c 1 parent 4bfaa87
@sstephenson sstephenson authored Darrick Wiebe committed
Showing with 4 additions and 1 deletion.
  1. +3 −0  lib/sprockets_application.rb
  2. +1 −1  lib/sprockets_controller.rb
View
3  lib/sprockets_application.rb
@@ -1,4 +1,7 @@
module SprocketsApplication
+ mattr_accessor :use_page_caching
+ self.use_page_caching = true
+
def self.routes(map)
map.resources(:sprockets, :only => [:index, :show])
end
View
2  lib/sprockets_controller.rb
@@ -1,5 +1,5 @@
class SprocketsController < ActionController::Base
- caches_page :show
+ caches_page :show, :if => Proc.new { SprocketsApplication.use_page_caching }
def index
show
Please sign in to comment.
Something went wrong with that request. Please try again.