Urara-Blog/node_modules/.pnpm-store/v3/files/8a/e582ca1f227da0fb22e0ad98de67eec5297244ac1d6eee043ecdfe01a96b0f23ed604097031fe447b6ea66e98c646616e70d7b2f1d3e73326904aa157e3c87
2022-08-14 01:14:53 +08:00

26 lines
677 B
Text

/*
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
import '../_version.js';
export const cacheOkAndOpaquePlugin = {
/**
* Returns a valid response (to allow caching) if the status is 200 (OK) or
* 0 (opaque).
*
* @param {Object} options
* @param {Response} options.response
* @return {Response|null}
*
* @private
*/
cacheWillUpdate: async ({ response }) => {
if (response.status === 200 || response.status === 0) {
return response;
}
return null;
},
};