From c05efa8d7ae464235cf83d7c0956e42dc6974103 Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:14 +0200 Subject: move *.html to *.md --- files/fr/web/api/caches/index.html | 80 -------------------------------------- files/fr/web/api/caches/index.md | 80 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 80 deletions(-) delete mode 100644 files/fr/web/api/caches/index.html create mode 100644 files/fr/web/api/caches/index.md (limited to 'files/fr/web/api/caches') diff --git a/files/fr/web/api/caches/index.html b/files/fr/web/api/caches/index.html deleted file mode 100644 index b5b57df7ee..0000000000 --- a/files/fr/web/api/caches/index.html +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: WindowOrWorkerGlobalScope.caches -slug: Web/API/caches -translation_of: Web/API/WindowOrWorkerGlobalScope/caches -original_slug: Web/API/WindowOrWorkerGlobalScope/caches ---- -

{{APIRef()}}{{SeeCompatTable}}

- -

La propriété en lecture seule  caches de l'interface {{domxref("WindowOrWorkerGlobalScope")}} retourne l'objet {{domxref("CacheStorage")}} associé au contexte actuel. Cet objet permet de stocker des ressources pour une utilisation hors-ligne et de générer des réponses personnalisées à des requêtes.

- -

Syntaxe

- -
var myCacheStorage = self.caches; // ou simplement caches
-
- -

Value

- -

Un objet de type {{domxref("CacheStorage")}}.

- -

Exemple

- -

L'exemple suivant montre comment mettre en cache un contexte de service worker pour stocker des ressources et les utiliser hors-ligne.

- -
this.addEventListener('install', function(event) {
-  event.waitUntil(
-    caches.open('v1').then(function(cache) {
-      return cache.addAll([
-        '/sw-test/',
-        '/sw-test/index.html',
-        '/sw-test/style.css',
-        '/sw-test/app.js',
-        '/sw-test/image-list.js',
-        '/sw-test/star-wars-logo.jpg',
-        '/sw-test/gallery/',
-        '/sw-test/gallery/bountyHunters.jpg',
-        '/sw-test/gallery/myLittleVader.jpg',
-        '/sw-test/gallery/snowTroopers.jpg'
-      ]);
-    })
-  );
-});
- -

Spécifications

- - - - - - - - - - - - - - - - - - - -
SpécificationStatusComment
{{SpecName('Service Workers', '#self-caches', 'caches')}}{{Spec2('Service Workers')}} -

Défini dans un WindowOrWorkerGlobalScope partiel dans la nouvelle spec.

-
{{SpecName('Service Workers')}}{{Spec2('Service Workers')}}Définition initiale.
- -

Compatibilité des navigateurs

- - - -

{{Compat("api.WindowOrWorkerGlobalScope.caches")}}

- -

Voir aussi

- - diff --git a/files/fr/web/api/caches/index.md b/files/fr/web/api/caches/index.md new file mode 100644 index 0000000000..b5b57df7ee --- /dev/null +++ b/files/fr/web/api/caches/index.md @@ -0,0 +1,80 @@ +--- +title: WindowOrWorkerGlobalScope.caches +slug: Web/API/caches +translation_of: Web/API/WindowOrWorkerGlobalScope/caches +original_slug: Web/API/WindowOrWorkerGlobalScope/caches +--- +

{{APIRef()}}{{SeeCompatTable}}

+ +

La propriété en lecture seule  caches de l'interface {{domxref("WindowOrWorkerGlobalScope")}} retourne l'objet {{domxref("CacheStorage")}} associé au contexte actuel. Cet objet permet de stocker des ressources pour une utilisation hors-ligne et de générer des réponses personnalisées à des requêtes.

+ +

Syntaxe

+ +
var myCacheStorage = self.caches; // ou simplement caches
+
+ +

Value

+ +

Un objet de type {{domxref("CacheStorage")}}.

+ +

Exemple

+ +

L'exemple suivant montre comment mettre en cache un contexte de service worker pour stocker des ressources et les utiliser hors-ligne.

+ +
this.addEventListener('install', function(event) {
+  event.waitUntil(
+    caches.open('v1').then(function(cache) {
+      return cache.addAll([
+        '/sw-test/',
+        '/sw-test/index.html',
+        '/sw-test/style.css',
+        '/sw-test/app.js',
+        '/sw-test/image-list.js',
+        '/sw-test/star-wars-logo.jpg',
+        '/sw-test/gallery/',
+        '/sw-test/gallery/bountyHunters.jpg',
+        '/sw-test/gallery/myLittleVader.jpg',
+        '/sw-test/gallery/snowTroopers.jpg'
+      ]);
+    })
+  );
+});
+ +

Spécifications

+ + + + + + + + + + + + + + + + + + + +
SpécificationStatusComment
{{SpecName('Service Workers', '#self-caches', 'caches')}}{{Spec2('Service Workers')}} +

Défini dans un WindowOrWorkerGlobalScope partiel dans la nouvelle spec.

+
{{SpecName('Service Workers')}}{{Spec2('Service Workers')}}Définition initiale.
+ +

Compatibilité des navigateurs

+ + + +

{{Compat("api.WindowOrWorkerGlobalScope.caches")}}

+ +

Voir aussi

+ + -- cgit v1.2.3-54-g00ecf