From e35d2e9115fcdb315e0c16636556f408e9fb9631 Mon Sep 17 00:00:00 2001 From: ayoayco Date: Sat, 24 Aug 2024 21:29:01 +0200 Subject: [PATCH] chore: update readme --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d3a4b92..dd370ce 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ [![Package information: NPM version](https://img.shields.io/npm/v/@ayco/astro-sw)](https://www.npmjs.com/package/@ayco/astro-sw) [![Package information: NPM license](https://img.shields.io/npm/l/@ayco/astro-sw)](https://www.npmjs.com/package/@ayco/astro-sw) -Use your own authored service worker with Astro. +Use your own authored [service worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) with Astro. -The integration accepts the path to your own authored [service worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) and automatically injects dynamic variables such as `__assets` generated by Astro for caching. +The integration accepts the path to your service worker and automatically injects dynamic variables such as `__assets` generated by Astro for caching. It works on all Astro output options: `static`, `server`, or `hybrid`, and lets developers retain the flexibility for various [caching strategies](https://developer.chrome.com/docs/workbox/caching-strategies-overview/). @@ -114,7 +114,6 @@ The integration accepts a configuration object with the following properties | esbuild | [BuildOptions](https://esbuild.github.io/api/) | optional | custom build options for your service worker script | | registrationHooks | object | optional | provide callbacks for various registration events; see section on [Registration Hooks](#registration-hooks) | - -## Example sw.js +## Background This integration was developed to support the Caching strategy needs of [Cozy](https://github.com/ayoayco/cozy) -- the modern reading companion for the Web. You can find an example service worker (`src/sw.mjs`) in the [repository](https://github.com/ayoayco/Cozy/blob/main/src/sw.mjs).