mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 12:18:45 -05:00
service worker
This commit is contained in:
@@ -4,12 +4,18 @@ import {registerRoute, setCatchHandler} from 'workbox-routing';
|
||||
import {CacheFirst, NetworkFirst, NetworkOnly, StaleWhileRevalidate} from 'workbox-strategies';
|
||||
import {ExpirationPlugin} from 'workbox-expiration';
|
||||
import {BackgroundSyncPlugin, Queue} from "workbox-background-sync";
|
||||
import { clientsClaim } from 'workbox-core'
|
||||
|
||||
|
||||
|
||||
cleanupOutdatedCaches()
|
||||
|
||||
declare let self: ServiceWorkerGlobalScope
|
||||
precacheAndRoute(self.__WB_MANIFEST)
|
||||
|
||||
self.skipWaiting()
|
||||
clientsClaim()
|
||||
|
||||
const OFFLINE_CACHE_NAME = 'offline-html';
|
||||
let script_name = typeof window !== 'undefined' ? localStorage.getItem('SCRIPT_NAME') : '/'
|
||||
var OFFLINE_PAGE_URL = script_name + 'offline/';
|
||||
|
||||
Reference in New Issue
Block a user