mirror of https://github.com/go-gitea/gitea.git
15 lines
336 B
JavaScript
15 lines
336 B
JavaScript
import {registerRoute} from 'workbox-routing';
|
|
import {StaleWhileRevalidate} from 'workbox-strategies';
|
|
|
|
const cachedDestinations = new Set([
|
|
'manifest',
|
|
'script',
|
|
'style',
|
|
'worker',
|
|
]);
|
|
|
|
registerRoute(
|
|
({request}) => cachedDestinations.has(request.destination),
|
|
new StaleWhileRevalidate({cacheName: 'static-cache-v2'}),
|
|
);
|