Skip to content

Commit

Permalink
Set "SprocketsApplication.use_page_caching = false" to prevent the Sp…
Browse files Browse the repository at this point in the history
…rocketsController#show concatenation from being written to disk when config.action_controller.perform_caching is true
  • Loading branch information
sstephenson authored and Darrick Wiebe committed Aug 25, 2009
1 parent 4bfaa87 commit 8be0fff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions 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
Expand Down
2 changes: 1 addition & 1 deletion 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
Expand Down

0 comments on commit 8be0fff

Please sign in to comment.