source: frontend/node_modules/workbox-strategies/src/plugins/cacheOkAndOpaquePlugin.ts

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 703 bytes
Line 
1/*
2 Copyright 2018 Google LLC
3
4 Use of this source code is governed by an MIT-style
5 license that can be found in the LICENSE file or at
6 https://opensource.org/licenses/MIT.
7*/
8
9import {WorkboxPlugin} from 'workbox-core/types.js';
10import '../_version.js';
11
12export const cacheOkAndOpaquePlugin: WorkboxPlugin = {
13 /**
14 * Returns a valid response (to allow caching) if the status is 200 (OK) or
15 * 0 (opaque).
16 *
17 * @param {Object} options
18 * @param {Response} options.response
19 * @return {Response|null}
20 *
21 * @private
22 */
23 cacheWillUpdate: async ({response}) => {
24 if (response.status === 200 || response.status === 0) {
25 return response;
26 }
27 return null;
28 },
29};
Note: See TracBrowser for help on using the repository browser.