Skip to content

Instantly share code, notes, and snippets.

@paneq
Created May 22, 2011 09:00
Show Gist options
  • Save paneq/985286 to your computer and use it in GitHub Desktop.
Save paneq/985286 to your computer and use it in GitHub Desktop.
Faster rendering due to caching
# Add to:
# Rails.root/config/environments/development.rb
# Faster rendering:
# Technique described here:
# http://rails.lighthouseapp.com/projects/8994/tickets/5847-rails-301-configaction_viewcache_template_loading-is-missing
#
# According to Jose this is already in Rails 3.1
raise NotImplementedError if Rails.version.starts_with?("3.1")
ActiveSupport.on_load(:after_initialize) do
ActionView::Resolver.class_eval do
def caching?
true
end
end
ActionController::Base.before_filter do
ActionController::Base.view_paths.each(&:clear_cache)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment