feat(service-worker): include CacheQueryOptions options in ngsw-config (#34663)

Previously it was not possible to provide `CacheQueryOptions` ([MDN](https://developer.mozilla.org/en-US/docs/Web/API/Cache)) for querying the Cache.
This commit introduces a new parameter called `cacheQueryOptions` for `DataGroup` and `AssetGroup`.
Currently only `ignoreSearch` is supported as `ignoreVary` and `ignoreMethod` would require using
the complete Request object for matching which is not possible with the current implementation.

Closes #28443

PR Close #34663
This commit is contained in:
Maximilian Koeller
2020-04-29 16:07:34 +02:00
committed by Alex Rickabaugh
parent 49be32c931
commit dc9f4b994e
13 changed files with 198 additions and 23 deletions

View File

@ -1,4 +1,5 @@
export declare interface AssetGroup {
cacheQueryOptions?: Pick<CacheQueryOptions, 'ignoreSearch'>;
installMode?: 'prefetch' | 'lazy';
name: string;
resources: {
@ -23,6 +24,7 @@ export declare interface DataGroup {
timeout?: Duration;
strategy?: 'freshness' | 'performance';
};
cacheQueryOptions?: Pick<CacheQueryOptions, 'ignoreSearch'>;
name: string;
urls: Glob[];
version?: number;