]> git.openstreetmap.org Git - rails.git/commitdiff
Don't cache the trace list for logged in users.
authorTom Hughes <tom@compton.nu>
Mon, 11 Jan 2010 00:16:21 +0000 (00:16 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 11 Jan 2010 00:16:21 +0000 (00:16 +0000)
app/controllers/application_controller.rb
app/controllers/trace_controller.rb

index acadfcc251fa13597ca0a6f9763305a1f04a72c9..479f24525bd106277699797d791e9f89af1994c1 100644 (file)
@@ -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
index 9b32c32a7c3b6e87fdcc9229d0f97dea292768c5..3769202da1b5026d597b2d91a011109991d88a78 100644 (file)
@@ -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]