---
title: "Discussion on \"Gzip Dockerized Angular App with Nginx — NgDocker\" | Hashnode"
description: "Discussion on \"Gzip Dockerized Angular App with Nginx — NgDocker\". Gzip Dockerized Angular App with Nginx — NgDocker\n\nLeveling up by taking performance improvement measures for our super friendly NgDocker app. In this article, we will explore how we can enable Gzip to improve performance at a hulking scale.\nThis art..."
url: "https://hashnode.com/posts/gzip-dockerized-angular-app-with-nginx-ngdocker/646521ff176347e0f056d396"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Gzip Dockerized Angular App with Nginx — NgDocker](https://zakimohammed.hashnode.dev/gzip-dockerized-angular-app-with-nginx-ngdocker?utm_source=hashnode&utm_medium=feed)

Gzip Dockerized Angular App with Nginx — NgDocker Leveling up by taking performance improvement measures for our super friendly NgDocker app. In this article, we will explore how we can enable Gzip to improve performance at a hulking scale. This art...

Apr 8, 2023 · 7 min read · zakimohammed.hashnode.dev  
Read the article

-   [#angular](https://hashnode.com/tag/angular)
-   [#gzip](https://hashnode.com/tag/gzip)
-   [#gzip-compression](https://hashnode.com/tag/gzip-compression)
-   [#nginx](https://hashnode.com/tag/nginx)

## Written by

[Zaki Mohammed Shaikh](https://hashnode.com/@ZakiMohammed)

@ZakiMohammed · Mumbai, India

  
[View profile](https://hashnode.com/@ZakiMohammed)

Learner, developer, coder and an exceptional omelet lover. Knows how to flip arrays or omelet or arrays of omelet.

Learner, developer, coder and an exceptional omelet lover. Knows how to flip arrays or omelet or arrays of omelet.

## Responses 1

Markdown supported · ⌘↵ to post

[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.
