2

I am trying to set up *.js and *.css compression on the fly on the Azure platform. I have an application running on Azure App Services. It serves uncompressed *.js and *.css files. I want to use the CDN profile so I added an endpoint. and configured it to compress JS and CSS files. Configuration But the files are still served uncompressed even if I access the App Service via the endpoint. (the uncompressed file has about 3 MB, compressed about 600 KB). Uncompressed Do I miss some configuration, that allows bypassing the uncompressed files through the CDN endpoint?

Is this a correct approach for App Services how to compress files on the fly?

Thank you for any help or advice.

1 Answers1

0

Is this a correct approach for App Services how to compress files on the fly?

Yes it is the correct approach to compress files on the fly.

Follow the below steps to troubleshoot whether the compression is completed or not:

  1. To check whether your files are being returned compressed, you need to use a tool like Fiddler or your browser's developer tools.

  2. Check the HTTP response headers returned with your cached CDN content. If there is a header named Content-Encoding with a value of gzip, bzip2, or deflate, your content is compressed.

enter image description here

There are several possible causes, including:

  • The requested content is not eligible for compression.
  • Compression is not enabled for the requested file type.
  • The HTTP request did not include a header requesting a valid compression type.
  • Origin is sending chunked content.

Note:

As with deploying new endpoints, CDN configuration changes take some time to propagate through the network.

Usually, changes are applied within 90 minutes.

If this is the first time you've set up compression for your CDN endpoint, you should consider waiting 1-2 hours to be sure the compression settings have propagated to the POPs.

RKM
  • 1,234
  • 1
  • 4
  • 9