cache-bust catalog.json (?_=Date.now) so Lampa.Reguest serves fresh content
This commit is contained in:
1 parent
46938814df
commit
5a9b4a56ba
1 file changed
+7
-1
@@ -16,6 +16,12 @@
|
||||
return base() + p.replace(/^\/+/, '');
|
||||
}
|
||||
|
||||
// Append a cache-busting param so Lampa.Reguest does not serve a stale copy.
|
||||
function bust(url) {
|
||||
var sep = url.indexOf('?') >= 0 ? '&' : '?';
|
||||
return url + sep + '_=' + Date.now();
|
||||
}
|
||||
|
||||
function esc(s) {
|
||||
return String(s == null ? '' : s)
|
||||
.replace(/&/g, '&').replace(/</g, '<')
|
||||
@@ -24,7 +30,7 @@
|
||||
|
||||
// Load catalog via Lampa native network layer (TV-safe, fetch fails on some devices)
|
||||
function loadCatalog(cb) {
|
||||
var url = base() + 'movies/catalog.json';
|
||||
var url = bust(base() + 'movies/catalog.json');
|
||||
if (Lampa.Reguest && Lampa.Reguest.get) {
|
||||
Lampa.Reguest.get(url, function (html) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user