Adjusting comments into files.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const CACHE_NAME = 'gridtv-v2';
|
||||
|
||||
// Ressources statiques à mettre en cache immédiatement
|
||||
// Static assets cached during installation.
|
||||
const STATIC_ASSETS = [
|
||||
'/',
|
||||
'/index.php',
|
||||
@@ -11,7 +11,7 @@ const STATIC_ASSETS = [
|
||||
'/assets/vendor/hls.min.js'
|
||||
];
|
||||
|
||||
// Install : mise en cache des assets statiques
|
||||
// Install: cache the static assets.
|
||||
self.addEventListener('install', e => {
|
||||
e.waitUntil(
|
||||
caches.open(CACHE_NAME)
|
||||
@@ -20,7 +20,7 @@ self.addEventListener('install', e => {
|
||||
);
|
||||
});
|
||||
|
||||
// Activate : purger les anciens caches
|
||||
// Activate: remove outdated caches.
|
||||
self.addEventListener('activate', e => {
|
||||
e.waitUntil(
|
||||
caches.keys().then(keys =>
|
||||
@@ -29,11 +29,11 @@ self.addEventListener('activate', e => {
|
||||
);
|
||||
});
|
||||
|
||||
// Fetch : stratégie selon le type de ressource
|
||||
// Fetch: choose a caching strategy based on resource type.
|
||||
self.addEventListener('fetch', e => {
|
||||
const url = new URL(e.request.url);
|
||||
|
||||
// Flux EPG/M3U et API GitHub : network only (pas de cache)
|
||||
// EPG/M3U feeds and the GitHub API stay network-only.
|
||||
if (
|
||||
url.pathname.includes('xmltv') ||
|
||||
url.pathname.includes('.m3u') ||
|
||||
@@ -43,7 +43,7 @@ self.addEventListener('fetch', e => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Assets statiques : cache first
|
||||
// Static assets use a cache-first strategy.
|
||||
if (
|
||||
e.request.destination === 'style' ||
|
||||
e.request.destination === 'script' ||
|
||||
@@ -63,7 +63,7 @@ self.addEventListener('fetch', e => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Pages PHP (index.php) : network first, fallback cache
|
||||
// PHP pages use network-first with cache fallback.
|
||||
e.respondWith(
|
||||
fetch(e.request)
|
||||
.then(res => {
|
||||
|
||||
Reference in New Issue
Block a user