source: frontend/node_modules/workbox-strategies/plugins/cacheOkAndOpaquePlugin.js

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: 677 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*/
8import '../_version.js';
9export const cacheOkAndOpaquePlugin = {
10 /**
11 * Returns a valid response (to allow caching) if the status is 200 (OK) or
12 * 0 (opaque).
13 *
14 * @param {Object} options
15 * @param {Response} options.response
16 * @return {Response|null}
17 *
18 * @private
19 */
20 cacheWillUpdate: async ({ response }) => {
21 if (response.status === 200 || response.status === 0) {
22 return response;
23 }
24 return null;
25 },
26};
Note: See TracBrowser for help on using the repository browser.