PHPackages                             meanbee/magento2-serviceworker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. meanbee/magento2-serviceworker

AbandonedArchivedMagento2-module[Utility &amp; Helpers](/categories/utility)

meanbee/magento2-serviceworker
==============================

A Magento 2 extension that adds Service Worker support.

2.2.0(8y ago)527.9k27MITPHP

Since Jan 31Pushed 4y ago2 watchersCompare

[ Source](https://github.com/meanbee/magento2-serviceworker)[ Packagist](https://packagist.org/packages/meanbee/magento2-serviceworker)[ RSS](/packages/meanbee-magento2-serviceworker/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (4)Versions (13)Used By (0)

Meanbee\_ServiceWorker
======================

[](#meanbee_serviceworker)

A Magento 2 extension that adds [Service Worker](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API) support.

Features:

- Fully customisable Service Worker script
- Cache-first approach for page assets resulting in faster page loads
- Offline cache for CMS and catalog pages allowing viewing previously visited pages while in poor network conditions

Installation
------------

[](#installation)

Add this extension to your Magento installation with Composer:

```
composer require meanbee/magento2-serviceworker

```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

The Service Worker is configured and enabled by default. However, Service Workers require the site to run on HTTPS.

Features can be customised in *Stores &gt; Configuration &gt; General &gt; Web &gt; Service Worker Settings*.

### Adding more logic

[](#adding-more-logic)

If the base service worker file doesn't fit all of your needs you can easily add more logic using the layout system, targeting the `serviceworker_index_js` handle:

```

```

FAQ
---

[](#faq)

### Why do page assets not appear to be cached when Magento is in default/developer mode?

[](#why-do-page-assets-not-appear-to-be-cached-when-magento-is-in-defaultdeveloper-mode)

Magento 2 uses a timestamp version string in the URL for static files to allow busting browser cache when the static content gets updated. In developer mode, this version string is updated for every unique page request. This means that from the browser's perspective, the static assets, such as CSS files, are completely different on each page, even though the content is the same. Therefore, when the assets get cached by the Service Worker in Magento 2 developer mode, they only get cached for that specific page. Production mode only generates the static assets through command line and keeps the version timestamp fixed, so it doesn't experience this issue.

Development
-----------

[](#development)

### Setting up a development environment

[](#setting-up-a-development-environment)

A Docker development environment is included with the project:

```
docker-compose run --rm cli magento-extension-installer Meanbee_ServiceWorker \
&& docker-compose up -d

```

### npm dependencies

[](#npm-dependencies)

The extension uses npm to manage some of its web dependencies. Dependencies are installed and updated using npm, then copied into the `src/` directory using an npm script. To update the web dependencies, run:

```
docker-compose run --rm node npm update
docker-compose run --rm node npm run build

```

### Testing Service Workers on Chrome

[](#testing-service-workers-on-chrome)

Chrome is very strict about security and only allows Service Workers on localhost, or on an HTTPS site with a valid certificate. To bypass these restrictions for testing, use the `--ignore-certificate-errors` and `--unsafely-treat-insecure-origin-as-secure` flags to run a less secure copy of Chrome:

```
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
    --user-data-dir=/tmp/chrome \
    --ignore-certificate-errors \
    --unsafely-treat-insecure-origin-as-secure=https://m2-meanbee-serviceworker.docker/

```

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~50 days

Recently: every ~40 days

Total

7

Last Release

3135d ago

Major Versions

1.1.0 → 2.0.02017-06-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/07666e20eb30bff741aaa38f1b450f4475f76fb019f6b52653f514b8b1ede18e?d=identicon)[meanbee](/maintainers/meanbee)

---

Top Contributors

[![tgerulaitis](https://avatars.githubusercontent.com/u/613076?v=4)](https://github.com/tgerulaitis "tgerulaitis (39 commits)")[![punkstar](https://avatars.githubusercontent.com/u/179072?v=4)](https://github.com/punkstar "punkstar (2 commits)")[![brosenberger](https://avatars.githubusercontent.com/u/2969243?v=4)](https://github.com/brosenberger "brosenberger (1 commits)")

---

Tags

magento2magento2-extensionpwaservice-worker

### Embed Badge

![Health badge](/badges/meanbee-magento2-serviceworker/health.svg)

```
[![Health](https://phpackages.com/badges/meanbee-magento2-serviceworker/health.svg)](https://phpackages.com/packages/meanbee-magento2-serviceworker)
```

###  Alternatives

[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68353.9k](/packages/run-as-root-magento2-prometheus-exporter)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1010.0k22](/packages/loki-magento2-components)[baldwin/magento2-module-url-data-integrity-checker

Magento 2 module which can find potential url related problems in your catalog data

282806.2k](/packages/baldwin-magento2-module-url-data-integrity-checker)[mage-os/module-inventory-reservations-grid

Add a grid with the list of inventory reservations.

1512.6k](/packages/mage-os-module-inventory-reservations-grid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
