Skip to content

Angular 6 - ServiceWorker not requesting gzipped content #24227

@adnan-kamili

Description

@adnan-kamili

I recently added service worker to my Angular 6.0.3 app. Everything works great.

I observed a slight increased initial load time when app is loaded the first time and to my surprise, the mainxxxx.js file being downloaded was 3.1 MB.

Cloudfront gzips the js files reducing the size of main.xxx.js to around 500KB, but it will only gzip when the client will send the

Accept-Encoding: gzip

request header. The browser was sending this header, but service worker requests don't have this header, which is a big problem because angular build files have very large size.

Is this a bug which will be fixed or service workers don't support gzip which would be a big disappointment.

Chrome 66, MacOS

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsarea: service-workerIssues related to the @angular/service-worker packagestate: confirmedtype: bug/fix

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions