It is a small annoyance when combining a PWA and Magento within the same hosting environment: The PWA replaces the original frontend and ships with a new Service Worker. But this also activates that same Service Worker for the Magento Admin Panel. Here is a small workaround to disable that service worker.
Caching strategies, offline, push notifications
A PWA is able to introduce new features in the frontend progressively. This might include features like caching, in the end leading to offline strategies, and other features like push notifications. With a lot of these PWA features, it is the Service Worker that allows for the magic to happen.
serviceworker.js), custom built or generated, that is added to the page and activated within the browser. The worker process even keeps on working when the website is not available, with the browser closed or the internet not working (offline).
Not for the backend
While these Service Worker features are cool on the frontend, they are often not needed in the backend. Even worse, sometimes caching features prevent the backend from working properly. In these cases, my new Yireo_DisableServiceWorkerInAdmin extension might come in handy. It simpy unregisters any Service Worker found to be running.
Same domain or different domains?
Because Service Workers are always bound to a specific domain, this is only needed when the Magento Admin Panel and the frontend share the same domain. However, what I personally do a lot is use separate domains instead: For instance, a frontend
www.example.org and a backend
admin.example.org, so that cookies do not conflict, weird session attacks have less impact. Plus, I can use separate PHP processes for each, so that the frontend has a smaller
memory_limit than the backend, for instance.
Anyway, using different domains is not mandatory, you can simply use the same domain for both frontend and backend. And that's where this module might come in handy.
Hope you enjoy this little widget.