Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-11898

WebJar resources should be cached permanently

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 6.4.3, 7.0-rc-1
    • 6.4.2
    • Webjar
    • None
    • Unit
    • High
    • Easy

    Description

      Since XWIKI-11056 we return 304 Not Modified which means the browser still has to make a request to check if there is a newer version of the file. I think we can safely cache the WebJar resources permanently because the WebJar version is included in the URL:

      /xwiki/bin/webjars/resources/path?value=requirejs%2F2.1.15%2Frequire.min.js
      

      So when we upgrade a WebJar dependency the URL will change and thus the browser will request the new version. Note that the version from the URL is normally detected automatically:

      $services.webjar.url('requirejs', 'require.min.js')
      

      For permanent caching we can use the same HTTP header as the JSX action.

      Attachments

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: