We try to boost our website performance by doing several things like caching, bundling, minification and Image Sprites, etc. But we forget to do configuration for dynamic compression for our AJAX requests. Let’s see how we can achieve it.
To demonstrate it, I am using IIS 7.5. In IIS 7, you need to enable Dynamic compression. I am not going in that way.
Let’s open IIS7.5 and select server name. Then you will see Configuration Editor in right side pane. Click to open it.
Once Configuration editor opens, select the section as ‘
httpCompression by expanding tree.
After selecting, just open
dynamicTypes as shown in screenshot.
Same add application/json; charset=utf-8.
Now close window and click Apply right hand side as follows:
Reset IIS and test your app, see how much time dynamic compression can save for you. Time can be seen for Ajax request in chrome developer tool or Fiddler.
If you click on request, you can see compression as gzip.
In this tip, we saw how we can configure dynamic compression on IIS. It will improve performance for your HTTP calls.