Understanding Compression and How it Works
A brief overview about the compression feature and how it works.
Summary
The compression feature of the Citrix NetScaler system compresses HTTP responses for browsers that are compression aware, thus improving the performance of Web sites with compressible content.
In a transaction management environment, users, very often, face problems such as poor Web site performance, huge download time, and high bandwidth usage. Also, Web site performance is affected by WAN latency and connection bottlenecks. The Citrix NetScaler system alleviates these problems by implementing lossless compression that reduces the number of packets of data transmitted, thus reducing both download time and bandwidth usage for users. In lossless compression, the exact original data is reconstructed from the compressed data.
How Compression Works
Compression is implemented at origin sites with HTML or other compressible content that is either statically or dynamically generated. The system compresses content of the MIME types such as text/html, text/plain, text/xml, text/css, text/rtf, application/msword, application/vnd.ms-excel, and application/vnd.ms-powerpoint. HTTP compression is interpreted by popular browsers such as Internet Explorer, Firefox, and Netscape. The system does not compress content of type application/octet-stream, binary, and bytes and images in GIF and JPEG formats.
The system configured with compression policies intercepts requests from compression-aware clients and applies the compression policies to determine whether the client can accept compressible content. After the system receives the HTTP response from the server, the content is examined to determine if it is compressible. If the content is compressible, it is compressed, and the compressed content is forwarded to the client. The response header is modified to indicate the type of compression performed.
The following diagram illustrates a compression deployment in a transparent, non-vserver mode where compression policies are enabled globally. This enables the compression policies to act on any service irrespective of the vserver the service is bound to. 
Compression entity model
As shown in this figure, to configure compression, you need to define services and compression polices. Services are entities that are logical representations of applications on the physical servers. The compression policies enable the system to identify the content that needs to be compressed. A compression policy consists of an expression and an action. An expression is created to identify the files entering the system, for example, HTML files, ASP files, or PDF files. An action defines the action the system performs on the file identified by the expression. For example, you can configure a compression policy comprising of an expression that identifies PDF files and an action that compresses the PDF files.
You can also configure compression in a vserver mode where the compression policies are bound to a load balancing vserver. This allows the compression policies to be evaluated for only the services bound to that vserver. This is illustrated in the following diagram. 
Compression entity model in a vserver mode
As shown in the figure, in this deployment, you need to configure a vserver, services, and compression policies, and bind the services and policies to the vserver. A vserver is an entity that identifies the least loaded origin server and directs client requests to the corresponding service. The system evaluates the compression policies and determines whether the response is compressible. The compressible content is compressed and sent to the client.