DEV: refresh all CDN endpoint URLs except the S3 uploads & assets. (#11937)
Using this added a temporary query param to force browsers to redownload all CDN endpoints.
This commit is contained in:
parent
2ee63a6a83
commit
e6a02469ad
|
@ -41,12 +41,13 @@ cdnUrls = ["<%= "#{GlobalSetting.s3_cdn_url}" %>", "<%= "#{GlobalSetting.cdn_url
|
|||
|
||||
if (cdnUrls.length > 0) {
|
||||
var cdnCacheName = "cdn-" + cacheVersion;
|
||||
var cdnUrl = "<%= "#{GlobalSetting.cdn_url}" %>";
|
||||
|
||||
var appendQueryStringPlugin = {
|
||||
requestWillFetch: function (args) {
|
||||
var request = args.request;
|
||||
|
||||
if (request.url.includes("avatar") || request.url.includes("emoji")) {
|
||||
if (request.url.startsWith(cdnUrl)) {
|
||||
var url = new URL(request.url);
|
||||
// Using this temporary query param to force browsers to redownload images from server.
|
||||
url.searchParams.append('refresh', 'true');
|
||||
|
|
Loading…
Reference in New Issue