Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
318 stars 53 forks source link

JS file not being returning GZIP'd for Static Web App #1379

Open bobharing opened 6 months ago

bobharing commented 6 months ago

When I view my static web app, I noticed that the response for my JS files are not returned with gzip encoding. According to this documentation, GZIP compression is automatically supposed to happen for JS files

To reproduce

  1. Go to https://www.bobharing.com/ with dev tools opened (using Edge Version 120.0.2210.91 (Official build) (arm64))
  2. View the https://www.bobharing.com/assets/js/app.058755c5.js file in the network tab.
  3. The request header mentions Accept-Encoding: gzip, deflate, br
  4. When you look in the response headers, there is no content-encoding header present.

Expected behavior JS file has GZIP encoding.

Screenshots

image

There is not content-encoding header present for the JS file.

Device info (if applicable):

Additional context There is the same issue for the CSS files.

ImpactMAC commented 5 months ago

Are you using "Enterprise-grade edge"?

We're experiencing this issue specifically when it's enabled. Compression works without it.

See issue #1340 & #1283

HowardvanRooijen commented 3 months ago

I can also repro the behaviour of Enterprise Edge enabled vs disabled on content served via ASWA:

ASWA-enterprise-edge-enabled

ASWA-enterprise-edge-disabled