From 708f8d6277bd0f218f8b85c1cc741fa2917fcb44 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Mon, 25 Jul 2011 15:24:58 +0100 Subject: Add cache headers to various pages (in three categories: short, medium, and long). --- app/controllers/general_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/controllers/general_controller.rb') diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 6e5c8c3fd..ffc97237a 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -20,9 +20,8 @@ class GeneralController < ApplicationController # New, improved front page! def frontpage - + medium_cache behavior_cache do - # get some example searches and public bodies to display # either from config, or based on a (slow!) query if not set body_short_names = MySociety::Config.get('FRONTPAGE_PUBLICBODY_EXAMPLES', '').split(/\s*;\s*/).map{|s| "'%s'" % s.gsub(/'/, "''") }.join(", ") @@ -66,6 +65,7 @@ class GeneralController < ApplicationController # Display WhatDoTheyKnow category from mySociety blog def blog + medium_cache @feed_autodetect = [] feed_url = MySociety::Config.get('BLOG_FEED', '') if not feed_url.empty? @@ -176,6 +176,7 @@ class GeneralController < ApplicationController end def custom_css + long_cache @locale = self.locale_from_params() render(:layout => false, :content_type => 'text/css') end -- cgit v1.2.3 From 2dd460cb432460fc32178140e3b4d6c31b55e883 Mon Sep 17 00:00:00 2001 From: David Cabo Date: Mon, 8 Aug 2011 13:22:47 +0200 Subject: I18n'd hardcoded WhatDoTheyKnow strings, mostly in mails. Use named variable substitution in gettext strings. --- app/controllers/general_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers/general_controller.rb') diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index ffc97237a..4fa603aab 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -63,7 +63,7 @@ class GeneralController < ApplicationController end end - # Display WhatDoTheyKnow category from mySociety blog + # Display blog entries def blog medium_cache @feed_autodetect = [] @@ -73,7 +73,7 @@ class GeneralController < ApplicationController @data = XmlSimple.xml_in(content) @channel = @data['channel'][0] @blog_items = @channel['item'] - @feed_autodetect = [ { :url => feed_url, :title => "WhatDoTheyKnow blog"} ] + @feed_autodetect = [{:url => feed_url, :title => "#{site_name} blog"}] else @blog_items = [] end -- cgit v1.2.3