aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/application.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/application.rb')
-rw-r--r--app/controllers/application.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb
index 9a1ef035b..e427fda9c 100644
--- a/app/controllers/application.rb
+++ b/app/controllers/application.rb
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: application.rb,v 1.52 2009-01-08 16:57:16 francis Exp $
+# $Id: application.rb,v 1.53 2009-07-14 23:30:37 francis Exp $
class ApplicationController < ActionController::Base
@@ -225,6 +225,12 @@ class ApplicationController < ActionController::Base
session[:last_body_id] = public_body.id
end
+ # Set cache headers for Squid reverse proxy in front of application
+ def cache_in_squid(max_age = 10)
+ response.headers["Vary"] = 'Cookie, Accept-Encoding'
+ expires_in max_age.minutes, :private => false
+ end
+
# URL generating functions are needed by all controllers (for redirects),
# views (for links) and mailers (for use in emails), so include them into
# all of all.