Static and dynamic content compression

Static content compression and dynamic content compression are features of the IIS. They compress content at site level. When enabled, each request for static or dynamic content that contains the Accept-Encoding: gzip or Accept-Encoding: deflate header causes the content to be compressed, as long as the compression scheme, specified in the header, is enabled in IIS. If the request does not contain this header, or the header specifies a compression scheme that is not enabled in IIS, the content is not compressed.

IMPORTANT: This IIS feature might break some HTTP modules that changes the response. You cannot use it with WebOptimizer.

Compress static content

You can compress responses to requests for static content. This way, when a client requests static content, such as .htm or .txt, it is compressed before it is served.

To enable static content compression, perform the following:

  1. Open your web.config file.
  2. Inside <system.webServer> tag, insert <urlCompression doStaticCompression="true" />
  3. Save and close the web.config file.

Compress dynamic content

You can compress responses to requests for dynamic content. This way, when a client requests dynamic content, such as ASP pages or ISAPI extensions, it is compressed before it is served.

RECOMMENDATION: Because dynamic compression consumes considerable CPU time and memory resources, we recommend using dynamic content compression on servers that have slow network connections, but large CPU resources.

NOTE: IIS does not cache compressed versions of dynamic content. If you have enabled output cache, you must compress dynamic content before it is cached.

  1. Open your web.config file.
  2. Inside <system.webServer> tag, insert 
    <urlCompression doDynamicCompression="true" dynamicCompressionBeforeCache="true" />
  3. Save and close the web.config file.

NOTE: You can turn on both static and dynamic content compression using one tag in the following way: <urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true" />

 

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

SSL offloading