Updated cahce bust in post
This commit is contained in:
parent
4dbb6e9f26
commit
d75dbf1f29
@ -52,8 +52,7 @@ self.addEventListener('fetch', function(event) {
|
|||||||
function cacheBust(request) {
|
function cacheBust(request) {
|
||||||
var url = request.url;
|
var url = request.url;
|
||||||
if (url.indexOf(self.location.origin) >= 0) {
|
if (url.indexOf(self.location.origin) >= 0) {
|
||||||
if (url.indexOf('.') < 0 && url[url.length - 1] !== '/') {
|
if (url[url.length - 1] !== '/' && (url.indexOf('.') < 0 || url.lastIndexOf('.') < self.location.origin.length)) {
|
||||||
// When dealing with directories make sure we append a trailing slash
|
|
||||||
url += `/`;
|
url += `/`;
|
||||||
}
|
}
|
||||||
return `${url}?${Math.random()}`;
|
return `${url}?${Math.random()}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user