title: Rails3 Rack response - undefined method response.body
body: <pre><code>  def call(env)
      status, headers, response = @app.call(env)
  
      if response.is_a? Array
        puts response.inspect
      else
        puts response.class.to_s
      end
  
      [status, headers, response]
    end
  </code></pre>
  
  <p>From development.log:</p>
  
  <p>First request:</p>
  
  <pre><code>Completed 200 OK in 95ms (Views: 35.9ms | ActiveRecord: 1.5ms)
  ActionDispatch::Response
  </code></pre>
  
  <p>Second and other requests:</p>
  
  <pre><code>Completed 200 OK in 77ms (Views: 76.3ms | ActiveRecord: 0.0ms)
  []
  </code></pre>
  
  <p>response is a: <code>ActionDispatch::Response</code> the first time a route gets called,
  for any other requests for that exact url, it is an empty <code>Array</code></p>
  
  <p>Page renders successfully in both cases, but I can't use <code>response.body</code> when response is an empty array.</p>
  
  <p>Is this normal Rails behavior? Is there some caching here even in dev environment?</p>