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.

          Form Name

            [JRASERVER-38160] screenshot applet does not cache-bust properly

            Bugfix Automation Bot made changes -
            Minimum Version New: 6.02
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2846882 ] New: JAC Bug Workflow v3 [ 2928768 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JIRA Bug Workflow w Kanban v7 - Restricted [ 2587495 ] New: JAC Bug Workflow v2 [ 2846882 ]
            Ignat (Inactive) made changes -
            Workflow Original: JIRA Bug Workflow w Kanban v6 - Restricted [ 1522834 ] New: JIRA Bug Workflow w Kanban v7 - Restricted [ 2587495 ]
            Confluence Escalation Bot (Inactive) made changes -
            Labels New: affects-server
            Owen made changes -
            Workflow Original: JIRA Bug Workflow w Kanban v6 [ 683926 ] New: JIRA Bug Workflow w Kanban v6 - Restricted [ 1522834 ]
            Peter Obara made changes -
            Remote Link New: This issue links to "Page (Extranet)" [ 78609 ]
            Bradley Ayers (Inactive) made changes -
            Fix Version/s New: 6.4-OD-6 [ 45390 ]
            Fix Version/s New: 6.3.5 [ 45210 ]
            Resolution New: Fixed [ 1 ]
            Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
            Bradley Ayers (Inactive) made changes -
            Description Original: 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:

            {code}
            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
            };
            {code}

            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.

            h3. Testing notes

            # Ensure the HTTP response for {{screenshot.jar}} has the {{cache-control: max-age}} header.
            # Ensure [~bayers] is on the pull request.
            # Ensure {{deployJava.js}} and {{deployJava.html}} also have appropriate caching.
            New: 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:

            {code}
            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
            };
            {code}

            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.

            h3. Testing notes

            # Ensure the HTTP response for {{screenshot.jar}} has the {{cache-control: max-age}} header.
            # Ensure [~bayers] is on the pull request.
            # Ensure {{deployJava.js}} and {{deployJava.html}} also have appropriate caching.
            # Avoid introducing any new JARs for JSON serialisation.
            Bradley Ayers (Inactive) made changes -
            Description Original: 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:

            {code}
            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
            };
            {code}

            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.

            h3. Testing notes

            # Ensure the HTTP response for {{screenshot.jar}} has the {{cache-control: max-age}} header.
            # Ensure [~bayers] is on the pull request.
            New: 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:

            {code}
            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
            };
            {code}

            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.

            h3. Testing notes

            # Ensure the HTTP response for {{screenshot.jar}} has the {{cache-control: max-age}} header.
            # Ensure [~bayers] is on the pull request.
            # Ensure {{deployJava.js}} and {{deployJava.html}} also have appropriate caching.

              bayers Bradley Ayers (Inactive)
              idick Ian Dick
              Affected customers:
              0 This affects my team
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: