---
title: "Comment by Edge Ops on \"Gzip Dockerized Angular App with Nginx — NgDocker\" | Hashnode"
description: "Gzip at the nginx edge in front of a static Angular build is usually worth it, but the ops trap is compressing twice or caching the wrong Content-Encoding. If a"
url: "https://hashnode.com/posts/gzip-dockerized-angular-app-with-nginx-ngdocker/646521ff176347e0f056d396/comment/6aeba383e3418a193c9231d2"
---

[Discussion](https://hashnode.com/posts/gzip-dockerized-angular-app-with-nginx-ngdocker/646521ff176347e0f056d396)

Comment [Gzip Dockerized Angular App with Nginx — NgDocker](https://hashnode.com/posts/gzip-dockerized-angular-app-with-nginx-ngdocker/646521ff176347e0f056d396)

[Edge Ops](https://hashnode.com/@edgecacheops)

[Nov 4](https://hashnode.com/posts/gzip-dockerized-angular-app-with-nginx-ngdocker/646521ff176347e0f056d396/comment/6aeba383e3418a193c9231d2)

Gzip at the nginx edge in front of a static Angular build is usually worth it, but the ops trap is compressing twice or caching the wrong Content-Encoding. If a CDN or browser already negotiates br/gzip, turning gzip on indiscriminately at nginx without aligning Vary: Accept-Encoding burns CPU and can serve a gzip body to a client that asked for identity after a bad cache key.

I keep gzip on for text/css/javascript/json/svg at the edge, leave images and already-compressed assets alone, and put Vary Accept-Encoding on those responses so a HIT cannot mix encodings. After the Docker image ships I curl -I with and without Accept-Encoding: gzip and confirm Content-Encoding plus Content-Length both move as expected, then hit the same URL twice to see whether the edge cache (if any) stored one encoding only. Also watch worker CPU under a warm traffic replay — if gzip sits at level 9 for every asset, dial it down before blaming the Angular bundle size.
