Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-79046

Confluence should send valid last-modified headers for .css & .js

    XMLWordPrintable

Details

    Description

      Issue Summary

      Confluence sometimes sends an invalid last-modified header for .css and .js files.  While this header is not required to be set (or set validly) for regular functioning of Confluence, it is part of http-standards compliance, specifically for caching software to use.  Sending an invalid header is known to cause problems with specific proxy/caching software.

      Environment

      Bug observed in:

      • Jira 8.13.7, 8.13.10, 8.15.1, 8.20.1
      • Confluence 7.4.11, 7.13.0, 7.17.2

      Bug fixed in Jira 8.20.8+

      Steps to Reproduce

      1. Run any of the affected Confluence or Jira versions
      2. Connect to Confluence or Jira over IBM Webseal proxy

      Expected Results

      Pages will load as expected.

      Actual Results

      Pages load, but do not load/display completely.  Page styling is missing, for example.  (.css and .js are failing to load)

      Get requests for .css and .js components will have the Response header Last-Modified set to:

      Wed, 31 Dec 1969 23:59:59 GMT

      Since this is one second before the beginning of Unix Time (Thu, 01 Jan 1970 00:00:00 GMT), Webseal will fail to calculate whether the cache should be refreshed and will return an error code instead of content.

      Workaround

      Disable cache-control in Webseal. For more information on Content Caching & the Last Modified Header in Webseal, see this IBM article: Content Caching in IBM Webseal

      For Confluence, it should be possible to cache those files regardless of the last-modified header value. This is because:

      We only cache static assets served by a Data Center application or Marketplace app. These are things that are only going to change when you upgrade your Data Center application or app. Dynamic content is not cached.

      Reference: https://confluence.atlassian.com/conf713/use-a-cdn-with-atlassian-data-center-applications-1077914891.html#UseaCDNwithAtlassianDataCenterapplications-Whatiscached?

      This means it should be safe to cache them and only invalidate those caches after upgrading the application or a plugin, regardless of the last-modified value.

      Note

      Testing Confluence 7.13.7 reveals it does not send the last-modified header on responses for .js and .css requests.

      Attachments

        Issue Links

          Activity

            People

              05a8667aef42 Saquia Naz
              2465d1b7d8cb Daniel C Berlin
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: