Permalink
Browse files

Added caching_allowed? method that is removed from Rails core

  • Loading branch information...
1 parent 6d1735a commit 26b16369c36440ed41c9b1fbd3ef5b9a5826b6c4 @michiels michiels committed Jan 28, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/action_controller/caching/pages.rb
@@ -185,6 +185,10 @@ def cache_page(content = nil, options = nil, gzip = Zlib::BEST_COMPRESSION)
self.class.cache_page(content || response.body, path, extension, gzip)
end
+
+ def caching_allowed?
+ (request.get? || request.head?) && response.status == 200
+ end
end
end
end

0 comments on commit 26b1636

Please sign in to comment.