3. Dynamic Compression

We recommend that dynamic compression is set up on the server to boost performance in the client. The downside is that it will cost a little more CPU load on the server side, but that’s just an option to be weighed each time depending on the resources available.

Configuring Dynamic Compression

Open the Server Manager. Go to the Dashboard, then click “Add roles and features”. Click Next through each page of the wizard, until you get to the Server Roles page. Locate the Dynamic Content Compression role under Web Server (IIS), Web Server, Performance and tick the checkbox. Continue to the Confirmation page and click Install.

  • In some Windows computers you open the “Turn Windows Features on or off” and navigate to Internet Information Services > World Wide Web Services > Performance features > Check the box for “Dynamic Content Compression”

inst

Once the role is installed go back to the Compression module page in IIS Manager and ensure that both dynamic compression and static compression are enabled. Note that you need to do this at the Server level not the Website level.

inst

Compression is now set up, but we still need to add the mimeTypes that we want to compress. Go to the Configuration Editor.

inst

Select system.webServer/httpCompression from the Section dropdown list

inst

and click on the edit button next to dynamicTypes:

inst

Add entries for the mimeTypes “application/json;charset=utf-8” and “application/json” with Enabled set to “True”. Note: Entry Path will be autofilled when you save the changes.

inst

Remember to press Apply on the changes after closing the mimeTypes window:

inst

Now you must reset the IIS for the changes to be applied. You can go to command line and do: iisreset

To confirm that compression is now enabled, open the AGR site in browser and check the response headers under the “Network” tab in the developer tools (F12 in Chrome, then reload page and look under “Headers”).