All Projects → GoogleChromeLabs → Sw Appcache Behavior

GoogleChromeLabs / Sw Appcache Behavior

Licence: apache-2.0
A service worker implementation of the behavior defined in a page's AppCache manifest.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Sw Appcache Behavior

Planktos
Serving websites over bittorrent
Stars: ✭ 481 (+881.63%)
Mutual labels:  service-worker
Vue Wordpress Pwa
An offline-first SPA using Vue.js, the WordPress REST API and Progressive Web Apps
Stars: ✭ 665 (+1257.14%)
Mutual labels:  service-worker
Elm Hn Pwa
Hacker News as a PWA built with Elm
Stars: ✭ 43 (-12.24%)
Mutual labels:  service-worker
Upup
✈️ Easily create sites that work offline as well as online
Stars: ✭ 4,777 (+9648.98%)
Mutual labels:  service-worker
Msw
Seamless REST/GraphQL API mocking library for browser and Node.js.
Stars: ✭ 7,830 (+15879.59%)
Mutual labels:  service-worker
Hoverboard
Conference website template
Stars: ✭ 935 (+1808.16%)
Mutual labels:  service-worker
Pwa Wp
WordPress feature plugin to bring Progressive Web Apps (PWA) to Core
Stars: ✭ 445 (+808.16%)
Mutual labels:  service-worker
Service Mocker
🚀 Next generation frontend API mocking framework
Stars: ✭ 1,033 (+2008.16%)
Mutual labels:  service-worker
Your First Pwapp
Code associated with Your First Progressive Web App codelab
Stars: ✭ 619 (+1163.27%)
Mutual labels:  service-worker
Budgeting
Budgeting - React + Redux + Webpack (tree shaking) Sample App
Stars: ✭ 971 (+1881.63%)
Mutual labels:  service-worker
Serviceworker Rails
Use Service Worker with the Rails asset pipeline
Stars: ✭ 535 (+991.84%)
Mutual labels:  service-worker
Sw Precache
Service Worker Precache is a module for generating a service worker that precaches resources. It integrates with your build process. Once configured, it detects all your static resources (HTML, JavaScript, CSS, images, etc.) and generates a hash of each file's contents. Information about each file's URL and versioned hash are stored in the generated service worker file, along with logic to serve those files cache-first, and automatically keep those files up to date when changes are detected in subsequent builds.
Stars: ✭ 5,276 (+10667.35%)
Mutual labels:  service-worker
Pwapp Demo
A very simple progressive web app demo that will help you get started.
Stars: ✭ 13 (-73.47%)
Mutual labels:  service-worker
Preact Pwa
Super fast progressive web app with small footprint & minimal dependancies
Stars: ✭ 507 (+934.69%)
Mutual labels:  service-worker
Pushkit
All the required components to set up independent web push notifications 🎈
Stars: ✭ 45 (-8.16%)
Mutual labels:  service-worker
Offline Plugin
Offline plugin (ServiceWorker, AppCache) for webpack (https://webpack.js.org/)
Stars: ✭ 4,444 (+8969.39%)
Mutual labels:  service-worker
Beats0.github.io
After a few hundred years, GitHub will become the world's largest digital cemetery, and most of the users have passed away. However, their homepages, projects and commit history describe what they did during their lifetime.
Stars: ✭ 23 (-53.06%)
Mutual labels:  service-worker
Sw 101 Gdgdf
Slides: Service Worker 101 @ GDG DevFest 2016
Stars: ✭ 48 (-2.04%)
Mutual labels:  service-worker
Parcel Plugin Sw Cache
📦👷 Parcel plugin for caching using a service worker
Stars: ✭ 45 (-8.16%)
Mutual labels:  service-worker
Next Pwa
Zero config PWA plugin for Next.js, with workbox 🧰
Stars: ✭ 909 (+1755.1%)
Mutual labels:  service-worker

About

A pair of modules meant to ease the transition off of AppCache and on to service workers.

Note: These libraries attempt to replicate the caching and serving behavior that AppCache offers, but does not include direct equivalents to the window.applicationCache interface, nor the related events that AppCache would fire in the window context.

Installation

There are two modules to install: one that is used from within the window context in your web app, and the other that's used in the context of your service worker.

npm install --save-dev appcache-polyfill-window
npm install --save-dev appcache-polyfill-sw

As an alternative to local installation & serving, you can load both libraries from a NPM CDN, like https://unpkg.com/ or https://www.pika.dev/.

Usage

Window client

<script type="module">
  import {init} from '/path/to/appcache-polyfill-window/build/index.modern.js';

  // Optional: define a callback that runs whenever caches are updated.
  // This is *rough* replacement for listening for AppCache updates.
  function myCachePopulatedCallback(urls) {
    // urls is an array of updated URLs
    // Your logic goes here.
  }

  init({
    cachePopulatedCallback: myCachePopulatedCallback,
  }).then(() => navigator.serviceWorker.register('sw.js'));
</script>

Service worker client

importScripts('/path/to/appcache-polyfill-sw/build/index.umd.js');

self.addEventListener('fetch', (event) => {
  // Alternatively, examine event.request and only use the
  // appcachePolyfill.handle() logic for a subset of requests.
  event.respondWith(appcachePolyfill.handle(event));
});

Feedback

Please open an issue with feedback or bug reports if you run in to problems.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].