Skip to content

Commit

Permalink
Make maxEntries configurable (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoferbaxter authored Aug 5, 2019
1 parent 4a50b38 commit af0bd1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/asset-caching/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export type AssetCachingOptions = Array<{
cachingStrategy: 'NETWORK_FIRST' | 'CACHE_FIRST' | 'STALE_WHILE_REVALIDATE';
denyList?: Array<RegExp>;
purgeOnQuotaError?: boolean;
maxEntries?: number;
}>;

// TODO(KB): Temporary Interface until Workbox v5. Replace when upgrading.
Expand Down Expand Up @@ -89,7 +90,7 @@ export class AssetCachingAmpModule implements AmpSwModule {
cacheName: AMP_ASSET_CACHE,
plugins: [
new AssetCachingPlugin({
maxEntries: 25,
maxEntries: assetCachingOption.maxEntries || 25,
denyList: assetCachingOption.denyList,
purgeOnQuotaError,
}),
Expand Down

0 comments on commit af0bd1d

Please sign in to comment.