aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2008-09-12 19:07:28 +0000
committerfrancis <francis>2008-09-12 19:07:28 +0000
commit9ffbadea9a4373aaed0e65055a9eec6db57beec1 (patch)
treed50ea1b30a0512446f9b80453ca5dd5a63a71507
parentd162441cc058eabc14a7f073f3fda6f5a9abf283 (diff)
Page cache attachments.
-rw-r--r--app/controllers/request_controller.rb3
-rw-r--r--config/environments/development.rb2
-rwxr-xr-xscript/clear-incoming-text-cache2
3 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 7614aee73..fe4904db7 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: request_controller.rb,v 1.106 2008-09-03 09:03:57 francis Exp $
+# $Id: request_controller.rb,v 1.107 2008-09-12 19:07:28 francis Exp $
class RequestController < ApplicationController
@@ -329,6 +329,7 @@ class RequestController < ApplicationController
end
# Download an attachment
+ caches_page :get_attachment
def get_attachment
@incoming_message = IncomingMessage.find(params[:incoming_message_id])
@info_request = @incoming_message.info_request
diff --git a/config/environments/development.rb b/config/environments/development.rb
index c8d38f64c..1cf3222b5 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -10,7 +10,7 @@ config.whiny_nils = true
# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
+config.action_controller.perform_caching = true
config.action_view.debug_rjs = true
# Don't care if the mailer can't send
diff --git a/script/clear-incoming-text-cache b/script/clear-incoming-text-cache
index 2b3273017..66d640aa6 100755
--- a/script/clear-incoming-text-cache
+++ b/script/clear-incoming-text-cache
@@ -6,4 +6,6 @@ LOC=`dirname $0`
$LOC/runner "ActiveRecord::Base.connection.execute(\"update incoming_messages set cached_attachment_text = null, cached_main_body_text = null\")"
+# Remove page caches
+rm -fr $LOC/../public/request