Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache Bust attempt #1923

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Cache Bust attempt #1923

wants to merge 1 commit into from

Conversation

jpwhite4
Copy link
Member

@jpwhite4 jpwhite4 commented Oct 9, 2024

Description

The update from 10.5 to 11.0 had substantial changes to various javascript files mostly due to the plotly updates. However, the filenames themselves didn't change. On our production systems, the document lifetime is set to a year, so Safari and Edge browsers are caching those files and not checking to see if they have been updated (we have etags enabled, but it seems the browsers don't check the etag values, instead they just load from cache).

Motivation and Context

This happens when you browse to XDMoD 11.0 with cached versions of the 10.5 javascript:

image

Fix is to add a query parameter with the XDMoD version number to all javascript file loads. This means that the browsers see the file from 10.5 as different from 11.0 (e.g. in 10.5 the browser requests "Summary.js" and with this change in 11.0 it will request "Summary.js?version=11.0.0". Which is a different filename and will cause the browser to request it since its not cached. The query parameters are ignored by the webserver when serving a normal file so the file contents are not changed by this request structure.

Tests performed

Installed on my port on dev and confirmed that it will pull it the first time:

image

and then cache it on subsequent pulls:

image

@jpwhite4 jpwhite4 marked this pull request as ready for review October 10, 2024 13:49
@aaronweeden
Copy link
Contributor

Do these also need to be updated?

  • xdmod: html/plotly_template.html
  • xdmod-appkernels: html/appkernel/index.php

@jpwhite4
Copy link
Member Author

Do these also need to be updated?

  • xdmod: html/plotly_template.html

The html template is used for the report generator and image export - these get run in a headless chrome with no profile - so there shouldn't be a cache that needs to be busted. We would have seen issues with image export if this was a problem and I don't believe that we have had porblems with that

Copy link
Contributor

@aaronweeden aaronweeden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these still need to be updated?

  • xdmod: classes/ExtJS/ExtJS.php
  • xdmod: configuration/assets.json
  • xdmod-supremm: configuration/assets.d/supremm.json
  • xdmod-appkernels: configuration/assets.d/appkernels.json
  • xdmod-xsede: configuration/assets.d/xsede.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants