PHPackages                             zhartaunik-fork/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. zhartaunik-fork/magento2-serviceworker

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

zhartaunik-fork/magento2-serviceworker
======================================

A Magento 2 extension that adds Service Worker support.

2.2.1(3y ago)06MITPHP

Since Jan 31Pushed 3y agoCompare

[ Source](https://github.com/zhartaunik/magento2-serviceworker)[ Packagist](https://packagist.org/packages/zhartaunik-fork/magento2-serviceworker)[ RSS](/packages/zhartaunik-fork-magento2-serviceworker/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (14)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

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 88.6% 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 ~284 days

Recently: every ~425 days

Total

8

Last Release

1399d ago

Major Versions

1.1.0 → 2.0.02017-06-20

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11556652?v=4)[Alexandr Skrashuk](/maintainers/zhartaunik)[@zhartaunik](https://github.com/zhartaunik)

---

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)")[![zhartaunik](https://avatars.githubusercontent.com/u/11556652?v=4)](https://github.com/zhartaunik "zhartaunik (2 commits)")[![brosenberger](https://avatars.githubusercontent.com/u/2969243?v=4)](https://github.com/brosenberger "brosenberger (1 commits)")

### Embed Badge

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

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

###  Alternatives

[snowdog/module-menu

Provides powerful menu editor to replace category based menus in Magento 2

3271.7M5](/packages/snowdog-module-menu)[baldwin/magento2-module-url-data-integrity-checker

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

281773.3k](/packages/baldwin-magento2-module-url-data-integrity-checker)[yireo/magento2-webp2

Magento 2 module to add WebP support to the Magento frontend

2091.2M7](/packages/yireo-magento2-webp2)[opengento/module-gdpr

Gdpr Compliance Module for Magento 2

14481.5k](/packages/opengento-module-gdpr)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69344.4k](/packages/run-as-root-magento2-prometheus-exporter)[magepal/magento2-customeraccountlinksmanager

Customer Account Links Manager for Magento2 allows you to quickly and easily remove unwanted links from customer account dashboard

4084.9k](/packages/magepal-magento2-customeraccountlinksmanager)

PHPackages © 2026

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