Spaces:
Running
Running
Download Source Code/sw.js from ameythakur/Deepfake-Audio: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/spaces/ameythakur/Deepfake-Audio/resolve/main/Source%20Code/sw.js
- Command line
-
hf download 'hf://spaces/ameythakur/Deepfake-Audio/Source Code/sw.js'
-
curl -L -o sw.js https://huggingface.co/spaces/ameythakur/Deepfake-Audio/resolve/main/Source%20Code/sw.js
446 Bytes
| const CACHE_NAME = 'deepfake-audio-v1'; | |
| const ASSETS_TO_CACHE = [ | |
| '/', | |
| '/file=favicon.png' | |
| ]; | |
| self.addEventListener('install', event => { | |
| event.waitUntil( | |
| caches.open(CACHE_NAME) | |
| .then(cache => cache.addAll(ASSETS_TO_CACHE)) | |
| ); | |
| }); | |
| self.addEventListener('fetch', event => { | |
| event.respondWith( | |
| caches.match(event.request) | |
| .then(response => response || fetch(event.request)) | |
| ); | |
| }); | |