Express 当我启用Gzip压缩时,Workbox Service Worker未能通过lighthouse审核

Express 当我启用Gzip压缩时,Workbox Service Worker未能通过lighthouse审核,express,gzip,service-worker,workbox,Express,Gzip,Service Worker,Workbox,我有一个next.js网站,它使用Express服务器进行SSR 我将用作Workbox和Next.js的包装器 我的站点通过lighthouse“可安装”审核,直到我使用启用gzip压缩。这是启用压缩时出现的故障(服务工作者仍然存在,已注册,并且在启用或未启用压缩时都是相同的) 不注册控制页面和起始url的服务工作程序。 服务工作者是一项技术,它使您的应用程序能够使用许多渐进式Web应用程序功能,例如脱机、添加到主屏幕和推送通知。了解更多 我已经尝试了启用压缩的标准方法 app.use(com

我有一个next.js网站,它使用Express服务器进行SSR

我将用作Workbox和Next.js的包装器

我的站点通过lighthouse“可安装”审核,直到我使用启用gzip压缩。这是启用压缩时出现的故障(服务工作者仍然存在,已注册,并且在启用或未启用压缩时都是相同的)

不注册控制页面和起始url的服务工作程序。 服务工作者是一项技术,它使您的应用程序能够使用许多渐进式Web应用程序功能,例如脱机、添加到主屏幕和推送通知。了解更多

我已经尝试了启用压缩的标准方法

app.use(compression())
我还尝试设置一个过滤器,以排除服务工作者被压缩-相同的结果

这是我的服务人员:

self.__precacheManifest = [
  {
    "url": "/_next/static/runtime/main-6d31a0ae74beef7a4022.js"
  },
  ... a bunch more of these
];

/**
 * Welcome to your Workbox-powered service worker!
 *
 * You'll need to register this file in your web app and you should
 * disable HTTP caching for this file too.
 * See [removed short url]
 *
 * The rest of the code is auto-generated. Please don't update this file
 * directly; instead, make changes to your Workbox build configuration
 * and re-run your build process.
 * See [removed short url]
 */

importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");

importScripts(

);

/**
 * The workboxSW.precacheAndRoute() method efficiently caches and responds to
 * requests for URLs in the manifest.
 * See [removed short url]
 */
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.precaching.suppressWarnings();
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});

workbox.routing.registerRoute(/^https:\/\/fonts\.gstatic\.com/, workbox.strategies.cacheFirst(), 'GET');
workbox.routing.registerRoute(/^https?.*/, workbox.strategies.networkFirst(), 'GET');
为什么gzip编码会破坏我的服务人员