<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,29 +2,26 @@ class LocationsController &lt; ApplicationController
   # GET /locations
   # GET /locations.xml
   def index
-    # ETags!
-    @last_updated_location = Location.find_with_deleted(:first, :order =&gt; 'updated_at DESC')
-    if @last_updated_location
-      response.last_modified = @last_updated_location.updated_at.utc
-      response.etag = @last_updated_location
-      head :not_modified and return if request.fresh?(response)
-    end
-  
-    respond_to do |format|
-      format.html do 
-        @locations = Location.with_geocodes.recent.all(params[:all] ? {} : {:limit =&gt; 15})
-        @location = Location.new(:signs =&gt; 'Blue')
-      end
-      format.json do
-        @locations = Location.with_geocodes.in_box(params[:northeast], params[:southwest])
-        render :json =&gt; {:locations =&gt; @locations}, :callback =&gt; json_callback
-      end
-      format.xml do
-        @locations = Location.with_geocodes
-        render :xml =&gt; @locations
-      end
-      format.atom do
-        @locations = Location.with_geocodes.recent        
+    # For ETags
+    @last = Location.find_with_deleted(:first, :order =&gt; 'updated_at DESC')
+
+    if @last.nil? || stale?(:last_modified =&gt; @last.updated_at.utc, :etag =&gt; @last)
+      respond_to do |format|
+        format.html do
+          @locations = Location.with_geocodes.recent.all(params[:all] ? {} : {:limit =&gt; 15})
+          @location = Location.new(:signs =&gt; 'Blue')
+        end
+        format.json do
+          @locations = Location.with_geocodes.in_box(params[:northeast], params[:southwest])
+          render :json =&gt; {:locations =&gt; @locations}, :callback =&gt; json_callback
+        end
+        format.xml do
+          @locations = Location.with_geocodes
+          render :xml =&gt; @locations
+        end
+        format.atom do
+          @locations = Location.with_geocodes.recent
+        end
       end
     end
   end
@@ -32,11 +29,9 @@ class LocationsController &lt; ApplicationController
   def removed
     # ETags!
     @last_updated_location = Location.find_with_deleted(:first, :order =&gt; 'updated_at DESC')
-    response.last_modified = @last_updated_location.updated_at.utc
-    response.etag = @last_updated_location
-    head :not_modified and return if request.fresh?(response)
-  
-    @locations = Location.with_geocodes.recent.find_only_deleted(:all)
+    if @last_updated_location.nil? || stale?(:last_modified =&gt; @last_updated_location.updated_at.utc, :etag =&gt; @last_updated_location)
+      @locations = Location.with_geocodes.recent.find_only_deleted(:all)
+    end
   end
 
   # GET /locations/1
@@ -44,15 +39,12 @@ class LocationsController &lt; ApplicationController
   def show
     @location = Location.find_with_deleted(params[:id])
     
-    # ETags!
-    response.last_modified = @location.updated_at.utc
-    response.etag = @location
-    head :not_modified and return if request.fresh?(response)
-
-    respond_to do |format|
-      format.html # show.html.erb
-      format.json { render :json =&gt; @location, :callback =&gt; json_callback }
-      format.xml  { render :xml =&gt; @location }
+    if stale?(:last_modified =&gt; @location.updated_at.utc, :etag =&gt; @location)
+      respond_to do |format|
+        format.html # show.html.erb
+        format.json { render :json =&gt; @location, :callback =&gt; json_callback }
+        format.xml  { render :xml =&gt; @location }
+      end
     end
   end
 </diff>
      <filename>app/controllers/locations_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-Subproject commit a3b7fa78bfdc33e45e39c095b67e02d50a2c7bea
+Subproject commit d85a7aecbb74bcabff9c13eed980e58db62611c7</diff>
      <filename>vendor/rails</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>77a7dd9f2b96cd368da9e7043afbefd7fd2bc115</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Morrison</name>
    <email>daniel@collectiveidea.com</email>
  </author>
  <url>http://github.com/collectiveidea/yardvote.com/commit/ff9397e492e75d2131899a031b5ee895383fba0c</url>
  <id>ff9397e492e75d2131899a031b5ee895383fba0c</id>
  <committed-date>2008-10-20T19:12:37-07:00</committed-date>
  <authored-date>2008-10-20T18:47:53-07:00</authored-date>
  <message>Trying out new Rails etag syntax.</message>
  <tree>1c8c56be086a1910c6cd26abf0ce723b902af0a1</tree>
  <committer>
    <name>Daniel Morrison</name>
    <email>daniel@collectiveidea.com</email>
  </committer>
</commit>
