<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -33,7 +33,7 @@ class SiteController &lt; ApplicationController
         expires_in self.class.cache_timeout, :public =&gt; true, :private =&gt; false
       else
         expires_in nil, :private =&gt; true, &quot;no-cache&quot; =&gt; true
-        headers['ETag'] = nil
+        headers['ETag'] = ''
       end
     end
     </diff>
      <filename>app/controllers/site_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,4 +27,16 @@ Feature: Serving pages from front-end
     When I go to page '/first'
     And I go to page '/first'
     Then I should get an &quot;X-Accel-Redirect&quot; header in the response
-  
\ No newline at end of file
+    
+  Scenario: page caching enabled
+    Given I have page caching on
+    When I go to page '/first'
+    Then I should get an &quot;ETag&quot; header in the response
+    And The &quot;Cache-Control&quot; header should be &quot;public&quot;
+
+  Scenario: page caching disabled
+    Given I have page caching off
+    When I go to page '/first'
+    Then I should not get an &quot;ETag&quot; header in the response
+    And The &quot;Cache-Control&quot; header should be &quot;private&quot;
+</diff>
      <filename>features/page_serving.feature</filename>
    </modified>
    <modified>
      <diff>@@ -35,10 +35,31 @@ Given /^I have turned on X\-Sendfile headers$/ do
   Radiant::Cache.use_x_sendfile = true
 end
 
-Then /^I should get an &quot;([^\&quot;]*)&quot; header in the response$/ do |header_key|
-  response.headers.to_hash[header_key].should be
+Then /^I should( not)? get an &quot;([^\&quot;]*)&quot; header in the response$/ do |status, header_key|
+  if status.nil?
+    response.headers.to_hash[header_key].should_not be_empty
+  else
+    response.headers.to_hash[header_key].should be_empty
+  end
 end
 
 Given /^I have turned on X\-Accel\-Redirect headers$/ do
   Radiant::Cache.use_x_accel_redirect = &quot;/cache&quot;
 end
+
+Given /^I have page caching (on|off)$/ do |status|
+  set_page_cache status
+end
+
+Then /^The &quot;([^\&quot;]*)&quot; header should be &quot;([^\&quot;]*)&quot;$/ do |header_key, value|
+  response.headers.to_hash[header_key].should =~ Regexp.new(value)
+end
+
+def set_page_cache(status)
+  Page.class_eval %{
+    def cache?
+      #{status != 'off'}
+    end
+  }, __FILE__, __LINE__
+end
+</diff>
      <filename>features/step_definitions/page_serving_steps.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5dc7d486ff3a4d348452a70524a67cc9a8e978dd</id>
    </parent>
  </parents>
  <author>
    <name>David Cato</name>
    <email>git@crunchyfrog.net</email>
  </author>
  <url>http://github.com/radiant/radiant/commit/3a96364749f19a7ca49f90ca9d91d0e3eb305242</url>
  <id>3a96364749f19a7ca49f90ca9d91d0e3eb305242</id>
  <committed-date>2009-06-06T09:37:24-07:00</committed-date>
  <authored-date>2009-05-26T21:45:47-07:00</authored-date>
  <message>Don't allow a nil ETag

Response header values cannnot be nil, so when page caching is disabled
the ETag header should be set to an empty string rather than nil.</message>
  <tree>d1eab7febca5a3afc31c03783227b75b2c678c99</tree>
  <committer>
    <name>Sean Cribbs</name>
    <email>seancribbs@gmail.com</email>
  </committer>
</commit>
