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

WebJar resources should be cached permanently

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.4.2
    • Fix Version/s: 6.4.3, 7.0-rc-1
    • Component/s: Webjar
    • Labels:
      None
    • Tests:
      Unit
    • Development Priority:
      High
    • Difficulty:
      Easy
    • Similar issues:

      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

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: