workbox-strategies#NetworkOnly JavaScript Examples

The following examples show how to use workbox-strategies#NetworkOnly. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: service-worker.js    From ReactCookbook-source with MIT License 6 votes vote down vote up
// Any other custom service worker logic can go here.

registerRoute(
    /\/endpoint/,
    new NetworkOnly({
        plugins: [new BackgroundSyncPlugin(
            'endPointQueue1', {
            maxRetentionTime: 24 * 60
        })]
    }),
    'POST'
);
Example #2
Source File: service-worker.js    From ReactCookbook-source with MIT License 5 votes vote down vote up
setDefaultHandler(new NetworkOnly());
Example #3
Source File: sw.js    From iris-messenger with MIT License 5 votes vote down vote up
registerRoute(
	'https://iris-notifications.herokuapp.com/notify',
	new NetworkOnly({
		plugins: [bgSyncPlugin]
	}),
	'POST'
);
Example #4
Source File: sw.js    From iris-messenger with MIT License 5 votes vote down vote up
registerRoute(
	'/peer_id',
	new NetworkOnly()
);
Example #5
Source File: service-worker.js    From pack11ty with MIT License 5 votes vote down vote up
// Never cache ranged requests (videos)
registerRoute(({ request }) => request.headers.has('range'), new NetworkOnly());