Diskdrive
Diskdrive

Reputation: 18825

How do I enable GZip compression for Linux Azure App Services?

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?

Upvotes: 1

Views: 3766

Answers (2)

Jun ZHOU
Jun ZHOU

Reputation: 161

It's because One is IIS (Windows) and the other is Kestrel (Windows).

Upvotes: 0

Jason Pan
Jason Pan

Reputation: 21873

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

Upvotes: 0

Related Questions