Skip to content
Branch: master
Find file History
prateekbh Implementing forced nullification (#25)
* WIP kill switch implementation

* fixing tests

* adding tests for kill switch

* resolving comment partially

* fixing tests

* resolving comments
Latest commit b376d0d Jun 13, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information. fixing modules readme Jan 28, 2019
constants.ts Implementing forced nullification (#25) Jun 13, 2019
index.ts Implementing forced nullification (#25) Jun 13, 2019

asset-caching module

This is an optional module, which the publisher can use to tell us about the assets that are important for a page’s completeness. These can be static assets like images and more but not an HTML file as it might conflict with a navigation route. These assets will be cached with one of the three caching strategies( STALE WHILE REVALIDATE, CACHE FIRST, NETWORK FIRST). A maximum of 25 such assets can be saved with this module.

In case the publisher wants NETWORK ONLY for any of the assets, they can specify the RegExp for the same in a denyList option.

Cache Purge:

A maximum of 25 such assets will be cached by this modules and will be purged as more requests come in to replace the least used asset.

Config Options:

The module accepts an array of object defined below. It helps the tell the service worker tell about different static assets, where they are located and how to cache them.

        regexp: RegExp;
        denyList?: Array<RegExp>;

How to use:

In order to include this module in the service worker use the config key and its options in the following manner

    assetCachingOptions: {} // config options here
You can’t perform that action at this time.