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:
Vinoth Kannan 2021-02-03 02:22:01 +05:30 committed by GitHub
parent 2ee63a6a83
commit e6a02469ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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');