Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-38160

screenshot applet does not cache-bust properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 6.3.5, 6.4-OD-6
    • 6.2
    • None

      When updating the screenshot applet the changes do not always take effect until the java cache is cleared, meaning that the applet is not properly sanitising the cache.

      The reason this happens is due to URL used to reference applet JAR:

      var attributes = {
          id: 'JIRA HTML5 Images Applet',
          codebase: AJS.Meta.get("context-path") + "/download/resources/com.atlassian.plugins.jira-html5-attach-images:jira-html5-attach-images-resources/",
          code: "com.atlassian.plugins.jira.screenshot.applet.ScreenshotApplet.class",
          archive: "applet/screenshot.jar",
          width: 0,
          height: 0
      };
      

      Note how the cache busting portion (/s/.../_/) is missing — it should appear between the context path and /download/. The cache busting portion isn't web resource manager (WRM) API, so there's no JavaScript way to retrieve a suitable value for that.

      One approach to implementing this is to use webResourceUrlProvider.getStaticPluginResourceUrl in conjunction with the new WRM.data API to transfer the URL from backend to frontend.

      Testing notes

      1. Ensure the HTTP response for screenshot.jar has the cache-control: max-age header.
      2. Ensure bayers is on the pull request.
      3. Ensure deployJava.js and deployJava.html also have appropriate caching.
      4. Avoid introducing any new JARs for JSON serialisation.

              bayers Bradley Ayers (Inactive)
              idick Ian Dick
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: