-
Notifications
You must be signed in to change notification settings - Fork 45
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
Reinstated cacheBuster to new-client #1324
Conversation
new-client/src/utils/FetchWrapper.js
Outdated
getMetaValue(key) { | ||
const el = document.getElementsByName(key); | ||
if (el && el[0]) { | ||
return el[0]?.attributes?.content?.value; | ||
} | ||
return null; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary, wouldn't something like this be more sufficient and work on all modern browsers anyway?
document.querySelector("meta[name='hajk-client-use-cache-buster']").getAttribute("content");
That oneliner on line 43 would be enough.
new-client/src/utils/FetchWrapper.js
Outdated
//this.useCacheBuster = process?.env?.REACT_APP_USE_CACHE_BUSTER === "true" || false; | ||
this.useCacheBuster = false; | ||
// Lets get the values from generated meta-tags | ||
this.hash = this.getMetaValue("hajk-client-git-hash") || ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be sure that the meta tag will always be called hajk-client-use-cache-buster
? I mean, it's created during build time by parsing %REACT_APP_NAME%-use-cache-buster
, so another value on REACT_APP_NAME
will break this completely.
You're absolutely right regarding these 😂 I should never make PR:s on Friday afternoons 😂 I'll fix on Monday. |
Now it's corrected. Thanx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍
Closes #1323