Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does adding this line to web.config do?

I read about here in respect to improvements in asp.net applications that we should add -

<urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true"/>

Can anyone please explain in simple words what this does and should every .net application should have this added ?

like image 587
Vishal Avatar asked Dec 15 '10 22:12

Vishal


2 Answers

  • The doDynamicCompression attribute of the element enables or disables dynamic content compression at the site, application, or folder level.
  • The doStaticCompression attribute of the element enables or disables static content compression at the site, application, or folder level.
  • The dynamicCompressionBeforeCache attribute specifies whether IIS will dynamically compress content that has not been cached. When the dynamicCompressionBeforeCache attribute is true, IIS dynamically compresses the response the first time a request is made and queues the content for compression. Subsequent requests are served dynamically until the compressed response has been added to the cache directory. Once the compressed response is added to the cache directory, the cached response is sent to clients for subsequent requests. When dynamicCompressionBeforeCache is false, IIS returns the uncompressed response until the compressed response has been added to the cache directory.

taken from iis.net

like image 158
Woot4Moo Avatar answered Jan 19 '23 03:01

Woot4Moo


Compression can help save bandwidth, and potentially decrease page loading times. With compression enabled, the server basically gzips the files before sending them to the client. This can take up a little more CPU time to do the compression, but the idea is that you will save time during transmission.

Dynamic compression will enable compression on dynamic scripts like aspx pages.

Static compression will enable compression on static files like html files and images.

like image 35
Donald Avatar answered Jan 19 '23 02:01

Donald