instance method fresh?

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.2.3

Signature

fresh?(response)

Check response freshness (Last-Modified and ETag) against request If-Modified-Since and If-None-Match conditions. If both headers are supplied, both must match, or the request is not considered fresh.

Parameters

response req
Source
# File actionpack/lib/action_controller/request.rb, line 126
    def fresh?(response)
      case
      when if_modified_since && if_none_match 
        not_modified?(response.last_modified) && etag_matches?(response.etag) 
      when if_modified_since 
        not_modified?(response.last_modified) 
      when if_none_match 
        etag_matches?(response.etag) 
      else 
        false 
      end 
    end

Defined in actionpack/lib/action_controller/request.rb line 126 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::AbstractRequest

Type at least 2 characters to search.

↑↓ navigate · open · esc close