UI loading improvements

Fixed: Caching for dynamically loaded JS files
Fixed: Incorrect caching of initialize.js
(cherry picked from commit f0cb5b81f140c67fa84162e094cc4e0f3476f5da)

Closes #2690
Closes #2696
This commit is contained in:
Mark McDowall
2023-07-17 20:37:02 -07:00
committed by Bogdan
parent e3247dc505
commit 7f25a3c4b1
11 changed files with 60 additions and 38 deletions

View File

@@ -62,9 +62,11 @@ namespace Readarr.Http.Frontend.Mappers
url = cacheBreakProvider.AddCacheBreakerToPath(match.Groups["path"].Value);
}
return string.Format("{0}=\"{1}{2}\"", match.Groups["attribute"].Value, UrlBase, url);
return $"{match.Groups["attribute"].Value}=\"{UrlBase}{url}\"";
});
text = text.Replace("__URL_BASE__", UrlBase);
_generatedContent = text;
return _generatedContent;

View File

@@ -37,7 +37,7 @@ namespace Readarr.Http.Frontend.Mappers
}
return resourceUrl.StartsWith("/content") ||
(resourceUrl.EndsWith(".js") && !resourceUrl.EndsWith("initialize.js")) ||
resourceUrl.EndsWith(".js") ||
resourceUrl.EndsWith(".map") ||
resourceUrl.EndsWith(".css") ||
(resourceUrl.EndsWith(".ico") && !resourceUrl.Equals("/favicon.ico")) ||