IntraWeb Archive

New property PreCompress added to ServerController.Compression options

New property PreCompress added to ServerController.Compression options

There is a new property in ServerController.Compression options, named PreCompress

This property controls whether ServerController will pre-compress all its internal JavaScript resources during application startup, using gzip compression.

Nowadays, EVERY browser supported by IntraWeb supports gzip compression. There is no excuse for not serving compressed JavaScript anymore. To understand the benefit of this new feature you have to understand how compression worked before, and how it works now:

In all prior IntraWeb versions, when some JavaScript internal resource like IWAjax.js was requested by the browser, IntraWeb had to do a few things:

  • Get IWAjax.js from its internal resource list, in plain text form
  • Use the JavaScript resource to build the response
  • Compress the response, if compression was enabled. In case of ISAPI or ASPX libraries running on IIS, the compression was done by IIS, and again, if enabled.

Now this is how it works:

  • If PreCompress = True, ALL JavaScript internal resources are compressed during application startup and REPLACE the uncompressed resources in the internal resource list.
  • When the resource is requested, IntraWeb gets the resource – ALREADY compressed – in the internal list
  • Build the response and add required headers, indicating that the response is already compressed/gzipped.

This new engine benefits all types of IntraWeb applications, not only Stand Alone servers, because IIS detects that the response is already compressed and DOES NOT need to dynamically compress it again. In heavy loaded environments this can significantly decrease the CPU usage because each JavaScript resource is compressed only once during the whole application life cycle. It also reduces the memory comsumption, because compressed resources require less memory in the internal resource list. Also makes the IntraWeb application faster because it does not compress JavaScript resources at each request anymore! Great, isn’t it?