1

I have deployed two app services

Windows https://mysamplewinapp.azurewebsites.net/

Linux https://mysamplelinuxapp.azurewebsites.net/

Going to https://www.giftofspeed.com/gzip-test/ and inputting the URLs in I can see that the Windows one GZIP is enabled, the Linux one GZIP is not enabled.

enter image description here

enter image description here

How do I get Linux app service to support Gzip compressed?

Diskdrive
  • 18,107
  • 27
  • 101
  • 167

1 Answers1

1

Newest

I carefully compared the differences between webapp deployed under windows and linux.

It is found that the webapp deployed under Linux has very little content in the Response Headers.

In windows.

enter image description here

In Linux.

enter image description here

Suggestion:

So we just need to add Content-Encoding: gzip in Response Headers, then we can solve the issue.

PRIVIOUS

We can enable gzip compression by code.

I don't know what language your webapp is written in. But there must be a way to achieve it through code or configuration files in the project. You need to search by google according to the code language, you can also tell me, I will help you solve it together.

Below test (NodeJS) wen can find my webapp in linux support Gzip compressed.

I have a nuxtjs project deployed in azure webapp linux environment.

enter image description here

enter image description here

I am new to nuxt, and create new demo then deploy it. So I think we can enable gzip compression by code.

So I seacrh gzip in my project.

enter image description here

Jason Pan
  • 15,263
  • 1
  • 14
  • 29
  • Sorry I don't see where you have it in your nuxt project to enable gzip? This is for an angular front end. According to this post, looks like angular cli no longer support compressing it via the cli https://stackoverflow.com/a/46280590/279911 – Diskdrive Dec 03 '20 at 07:23
  • @Diskdrive My focus is to describe that we can try to implement gzip through code. My project is just an example to prove that gzip is supported under Linux. – Jason Pan Dec 03 '20 at 07:26
  • @Diskdrive My answer is just to tell you the support under linux, you can tell me your code language is .net, nodejs or other, so as to better help you, right? – Jason Pan Dec 03 '20 at 07:27
  • This is for an angular app. – Diskdrive Dec 03 '20 at 08:46
  • @Diskdrive What version of Angular is your project? I will try to create and test it later. – Jason Pan Dec 03 '20 at 08:48
  • Angular 11. Should be able to generate it using the cli – Diskdrive Dec 03 '20 at 08:51
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/225509/discussion-between-jason-pan-and-diskdrive). – Jason Pan Dec 04 '20 at 06:52
  • @Diskdrive Sorry to reply you so late. I have studied this question carefully, and I will update it in the answer. The specific operation still needs to be operated by yourself. – Jason Pan Dec 04 '20 at 08:05
  • @Diskdrive You need to add `Content-Encoding: gzip` to `Response Headers` by yourself. – Jason Pan Dec 04 '20 at 08:18