Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Unresolved
    • Labels:
      None

      Description

      To avoid sending resources that don't need to be sent, thus saving bandwidth, HTTP 1.1 defines the If-Modified-Since: and If-Unmodified-Since: request headers. The former says "only send the resource if it has changed since this date"; the latter says the opposite. Clients aren't required to use them, but HTTP 1.1 servers are required to honor requests that do use them.

      Unfortunately, due to earlier HTTP versions, the date value may be in any of three possible formats:

      If-Modified-Since: Fri, 31 Dec 1999 23:59:59 GMT
      If-Modified-Since: Friday, 31-Dec-99 23:59:59 GMT
      If-Modified-Since: Fri Dec 31 23:59:59 1999

      Again, all time values in HTTP use Greenwich Mean Time (though try to be tolerant of non-GMT times). If a date with a two-digit year seems to be more than 50 years in the future, treat it as being in the past-- this helps with the millennium bug. In fact, do this with any date handling in HTTP 1.1.

      Although servers must accept all three date formats, HTTP 1.1 clients and servers must only generate the first kind.

      If the date in either of these headers is invalid, or is in the future, ignore the header.

      If, without the header, the request would result in an unsuccessful (non-200-level) status code, ignore the header and send the non-200-level response. In other words, only apply these headers when you know the resource would otherwise be sent.

      The If-Modified-Since: header is used with a GET request. If the requested resource has been modified since the given date, ignore the header and return the resource as you normally would. Otherwise, return a "304 Not Modified" response, including the Date: header and no message body, like

      HTTP/1.1 304 Not Modified
      Date: Fri, 31 Dec 1999 23:59:59 GMT
      [blank line here]

      The If-Unmodified-Since: header is similar, but can be used with any method. If the requested resource has not been modified since the given date, ignore the header and return the resource as you normally would. Otherwise, return a "412 Precondition Failed" response, like

      HTTP/1.1 412 Precondition Failed
      [blank line here]

      See: http://www.jmarshall.com/easy/http/#http1.1s8

        Activity

        Anonymous created issue -
        Hide
        Ulrich Stärk added a comment -

        This sounds like something the StaticContentHandler should be aware of.

        Show
        Ulrich Stärk added a comment - This sounds like something the StaticContentHandler should be aware of.
        Hide
        Ulrich Stärk added a comment -

        Last pieces of #21 (StaticContentHandler) and #28 (Handle If-Modified-Since) (closed by f12cf0b2d76ca8cab499533bb11d8584fa5557c9) (closed by f12cf0b2d76ca8cab499533bb11d8584fa5557c9)

        Show
        Ulrich Stärk added a comment - Last pieces of #21 (StaticContentHandler) and #28 (Handle If-Modified-Since) (closed by f12cf0b2d76ca8cab499533bb11d8584fa5557c9) (closed by f12cf0b2d76ca8cab499533bb11d8584fa5557c9)
        Tony Stevenson made changes -
        Field Original Value New Value
        Project Deft [ 12311521 ] Apache AWF [ 12313220 ]
        Key DEFT-28 AWF-71
        Reporter Niklas Gustavsson [ niklas ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Niklas Gustavsson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development