mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-01-22 16:46:28 +01:00
Try use NetworkFirst, with 5s timeout
This commit is contained in:
parent
c4bba6e507
commit
79ba6cdc29
1 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
import { CacheableResponsePlugin } from 'workbox-cacheable-response';
|
||||
import { ExpirationPlugin } from 'workbox-expiration';
|
||||
import { RegExpRoute, registerRoute, Route } from 'workbox-routing';
|
||||
import { CacheFirst, StaleWhileRevalidate } from 'workbox-strategies';
|
||||
import { CacheFirst, NetworkFirst } from 'workbox-strategies';
|
||||
|
||||
self.__WB_DISABLE_DEV_LOGS = true;
|
||||
|
||||
|
@ -50,8 +50,9 @@ const apiRoute = new RegExpRoute(
|
|||
// Matches:
|
||||
// - statuses/:id/context - some contexts are really huge
|
||||
/^https?:\/\/[^\/]+\/api\/v\d+\/(statuses\/\d+\/context)/,
|
||||
new StaleWhileRevalidate({
|
||||
new NetworkFirst({
|
||||
cacheName: 'api',
|
||||
networkTimeoutSeconds: 5,
|
||||
plugins: [
|
||||
new ExpirationPlugin({
|
||||
maxAgeSeconds: 5 * 60, // 5 minutes
|
||||
|
|
Loading…
Reference in a new issue