From 7cdcbdc4b851b348bb21e0f2ff437138e8b9884b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 16 Jan 2013 21:00:41 +0100 Subject: Added page caching for the gemeinschaft_setup#new page. --- lib/tasks/heater.rake | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib') diff --git a/lib/tasks/heater.rake b/lib/tasks/heater.rake index 7d026d9..11862a5 100644 --- a/lib/tasks/heater.rake +++ b/lib/tasks/heater.rake @@ -1,6 +1,17 @@ namespace :heater do desc "Warm up the cache." task :preheat => :environment do + if GemeinschaftSetup.any? + else + # This is a fresh installation. + # + if Rails.env.production? + require 'open-uri' + open('/dev/null', 'wb') do |file| + file << open("http://localhost/gemeinschaft_setups/new").read + end + end + end end end \ No newline at end of file -- cgit v1.2.3