-
Bug
-
Resolution: Fixed
-
Low (View bug fix roadmap)
-
6.2
-
None
-
6.02
-
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
- 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.
- relates to
-
JRASERVER-31917 Rewrite screenshot applet using not-java
- Closed
- mentioned in
-
Page Failed to load
Form Name |
---|
[JRASERVER-38160] screenshot applet does not cache-bust properly
Minimum Version | New: 6.02 |
Workflow | Original: JAC Bug Workflow v2 [ 2846882 ] | New: JAC Bug Workflow v3 [ 2928768 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Workflow | Original: JIRA Bug Workflow w Kanban v7 - Restricted [ 2587495 ] | New: JAC Bug Workflow v2 [ 2846882 ] |
Workflow | Original: JIRA Bug Workflow w Kanban v6 - Restricted [ 1522834 ] | New: JIRA Bug Workflow w Kanban v7 - Restricted [ 2587495 ] |
Labels | New: affects-server |
Workflow | Original: JIRA Bug Workflow w Kanban v6 [ 683926 ] | New: JIRA Bug Workflow w Kanban v6 - Restricted [ 1522834 ] |
Remote Link | New: This issue links to "Page (Extranet)" [ 78609 ] |
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 ] |
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. |
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. |