In a nutshell:
doDynamicCompression
tells IIS whether it should compress dynamically generated content, i.e. content generated by your scripts (ASP, PHP, ASP.NET etc).
doStaticCompression
tells IIS whether to compress static files e.g. PDF's, JPEGS etc that actually exist on the file system.
This answer here then further explains the difference between urlCompression
and httpCompression
:
What is the difference between httpCompression and urlCompression?
"urlCompression specifies what to
compress and httpCompression indicates
how to do the compression."
To control how content (static or dynamic) is compressed you would then specify the <httpCompression>
setting. With this you can control the compression scheme (gzip or deflate), where compressed content is stored, disk space limits for compressed content, CPU limits when compressing content etc. You can also specify more fine grained control over the different content types (mime types) that can be compressed.