Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-469

ResourceHandler always sets Expires header with the current time

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.2.8.Final, 1.3.0.Beta2
    • 1.2.7.Final
    • None
    • None

    Description

      ResourceHandler is always setting an Expires header with the current time. Shouldn't this time be now + cacheTime (or omit the Expires header altogether)?

      From ResourceHandler:

      //we set caching headers before we try and serve from the cache
      if (cachable && cacheTime != null) {
          exchange.getResponseHeaders().put(Headers.CACHE_CONTROL, "public, max-age=" + cacheTime);
          if (System.currentTimeMillis() > lastExpiryDate) {
              long date = System.currentTimeMillis();
              lastExpiryHeader = DateUtils.toDateString(new Date(date));
              lastExpiryDate = date;
          }
          exchange.getResponseHeaders().put(Headers.EXPIRES, lastExpiryHeader);
      }
      

      Attachments

        Activity

          People

            sdouglas1@redhat.com Stuart Douglas
            blakeday Michael Day (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: