Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 6fcb7bfda3818d0e717758895be9a364bf546f1e 1 parent fb2fa55
Sam Stephenson authored
3  lib/sprockets_application.rb
... ... @@ -1,4 +1,7 @@
1 1 module SprocketsApplication
  2 + mattr_accessor :use_page_caching
  3 + self.use_page_caching = true
  4 +
2 5 class << self
3 6 def routes(map)
4 7 map.resource(:sprockets)
2  lib/sprockets_controller.rb
... ... @@ -1,5 +1,5 @@
1 1 class SprocketsController < ActionController::Base
2   - caches_page :show
  2 + caches_page :show, :if => Proc.new { SprocketsApplication.use_page_caching }
3 3
4 4 def show
5 5 render :text => SprocketsApplication.source, :content_type => "text/javascript"

1 comment on commit 6fcb7bf

Sven Fuchs

Comparing the commit message ("when config.action_controller.perform_caching is true") to the implementation shouldn't that be

:if => Proc.new { ActionController::Base.perform_caching && SprocketsApplication.use_page_caching }

or something like that? As in "don't ever cache in development mode cause we'd wtf the hell out of those poor guys"? As in "me"

;)

Please sign in to comment.
Something went wrong with that request. Please try again.