From f5777a881f6f612712c8aa8fb88f6a09b3906a6c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 11 Jan 2010 00:16:21 +0000 Subject: [PATCH] Don't cache the trace list for logged in users. --- app/controllers/application_controller.rb | 6 ++++++ app/controllers/trace_controller.rb | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index acadfcc25..479f24525 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -244,6 +244,12 @@ class ApplicationController < ActionController::Base expire_fragment(Regexp.new(Regexp.escape(path) + "\\..*")) end + ## + # is the requestor logged in? + def logged_in? + !@user.nil? + end + private # extract authorisation credentials from headers, returns user = nil if none diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 9b32c32a7..3769202da 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -15,7 +15,8 @@ class TraceController < ApplicationController before_filter :offline_redirect, :only => [:create, :edit, :delete, :data, :api_data, :api_create] around_filter :api_call_handle_error, :only => [:api_details, :api_data, :api_create] - caches_action :list, :view, :layout => false + caches_action :list, :unless => :logged_in?, :layout => false + caches_action :view, :layout => false caches_action :georss, :layout => true cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create] cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create] -- 2.43.2