Skip to content
Smarter by Design.Simpler for Business

Compression ​

What Is the Compression Profile? ​

Compression is a configuration profile that makes it possible for the responses sent to the clients on the HTTP vServices running on TR7 to be transmitted compressed according to certain algorithms.

In the TR7 architecture, compression management is designed on a profile basis. The compression algorithm, the level and the target file types are defined centrally and applied by being assigned to the related vServices. Compression Profiles work at the vService level and are valid for Layer 7 (HTTP/HTTPS) traffic.

When a Compression Profile is defined, TR7 compresses the responses coming from the Backend Services according to the determined MIME types and transmits them to the client. The client browser states the compression algorithms it supports in the Accept-Encoding header and TR7 responds accordingly.

TR7 can perform the compression operation with the GZIP and DEFLATE algorithms. Both are standard HTTP compression methods that are widely supported and provide efficient compression.

The benefits it provides

  • The bandwidth usage is reduced considerably.
  • The page loading times are improved.
  • The network costs are lowered.
  • The user experience is increased.

The Importance of the Compression Profile ​

In modern web applications, HTTP compression is not only an optimization technique that provides bandwidth saving; it is a critical component that has a direct effect on the user experience, the page performance and the operational costs.

In web traffic, text-based content (HTML, CSS, JavaScript, JSON, XML) takes an important place. When this content is sent without being compressed, unnecessary bandwidth consumption and long loading times occur. Especially on mobile users and on connections with low bandwidth, this situation can lead to critical performance problems.

The compression mechanism can reduce the size of text-based content by 60-80%. For example, a 100 KB JavaScript file can drop to 20-30 KB after compression. This provides a dramatic improvement in the page loading times.

The fact that compression can be defined on a profile basis and at the vService level on TR7 makes it possible for different applications to be managed according to their different compression requirements. A text-heavy API service and a web site that serves static content can be optimized on the same system without affecting each other.

60-80%
Size reduction
The typical gain on text-based content
2-3×
Page speed
The improvement in the loading times
50-80%
Bandwidth cost
The decrease in the monthly traffic bill
↑ SEO
Core Web Vitals
A positive effect on the Google ranking

For this reason, Compression Profiles are one of the basic building blocks of offering high-performance and efficient services on TR7.

The Default Compression Profile Behavior ​

When the Compression feature is activated on a vService on TR7, the system starts to work with the default compression profile values. This profile offers balanced compression parameters for general use scenarios and can be used for standard web applications without additional configuration.

The values applied within the scope of the default Compression Profile:

ParameterValueDescription
Compression AlgorithmGZIPIt states that the response content will be compressed using the GZIP algorithm.
Compression Level1It provides minimum CPU consumption by using the fastest compression level.
OffloadingDisabledThe compression is performed by TR7; the Backend Service is not prevented from compressing as well.
File Typestext/plainIt states that only the responses with the text/plain content type will be compressed.

These values provide basic compression with low CPU usage. They are sufficient for a quick start; however, they do not guarantee the optimal compression strategy in every application. When different MIME types, higher compression levels or special requirements are in question, configuring the profiles specifically for the application is recommended.

Effects and Behavior ​

The parameters defined within the scope of the Compression Profiles make it possible for the responses to be compressed in a controlled way during the traffic flow on TR7. The process exhibits critical behaviors in terms of both a performance increase and resource usage.

The sequence diagram below shows how the compression decision is made during the passage of an HTTP request over TR7:

In the sections below, the behavior of every step of the process is explained in detail.

INFO

The Client Compatibility Check ​

TR7 checks the Accept-Encoding header coming from the client. If the client has stated GZIP or DEFLATE support, the response is compressed with the related algorithm. If it does not support it, the response is sent without being compressed.

INFO

The MIME Type Match ​

Only the MIME types defined in the profile are compressed. For example, if text/html and application/json are defined, the responses of these types are compressed; the content that is already compressed, such as image/png, is not affected.

INFO

The Effect of the Compression Level ​

Low levels (1-3) provide fast compression and low CPU usage. High levels (7-9) offer a better compression ratio but increase the CPU usage.

INFO

The Offloading Behavior ​

When it is activated, the compression performed by the Backend Service is disabled and the operation is carried out entirely on TR7. This is used in order to apply a consistent compression policy.

INFO

The Response Headers ​

The Content-Encoding: gzip or Content-Encoding: deflate header is added to the compressed responses. The client reads this header and decompresses the content.

Thanks to this behavior model, Compression Profiles improve the response times while reducing the bandwidth usage and make it possible for the system resources to be used efficiently.

The correct configuration of the compression parameters is critically important in terms of the performance and the resource efficiency of the services running on TR7. The default values offer a balanced starting point for general use scenarios; they may need to be adjusted depending on the application type, the content characteristics and the server capacity.

TIP

High-Traffic Web Sites ​

In high-traffic environments where the CPU resources are critical:

  • The Compression Level must be kept low (1-3).
  • The GZIP algorithm should be preferred (wider client support).
  • Only text-based MIME types must be targeted.

This approach provides acceptable compression while minimizing the CPU load.

TIP

API Services ​

On the APIs that serve JSON and XML responses:

  • The Compression Level can be kept at a medium level (4-6).
  • The application/json, application/xml and text/xml MIME types must be added.
  • Since the API responses are usually small, a high level may be unnecessary.

Compression on the API responses provides an important performance increase, especially for mobile clients.

TIP

Static Content Services ​

On the services that serve CSS, JavaScript and HTML files:

  • The Compression Level can be kept high (6-9).
  • The text/html, text/css, application/javascript and text/javascript MIME types must be added.
  • Since static content can be cached, a high compression ratio provides a benefit in the long term.

On static content, high compression, when combined with caching, offers maximum efficiency.

TIP

Environments with Low CPU Capacity ​

In the environments with limited CPU resources:

  • The Compression Level must be kept at the minimum (1).
  • Only the most critical MIME types must be compressed.
  • If the Backend Service can perform compression, Offloading must be evaluated.

In the environments where a CPU bottleneck is experienced, compression must be configured carefully; if necessary, it must be limited to only the content that provides the highest gain.

While the compression values are being determined, the application behavior, the content types and the server capacity must be evaluated together. The fact that Compression profiles can be defined on a vService basis on TR7 makes it possible for different optimizations to be applied for different services in a safe and central way.

The Modify Response Content action disables compression

If the Modify Response Content action is defined on the same vService, an uncompressed response is requested from the Backend Service so that the content can be read. Since this request is applied to all the traffic independently of the condition, the responses are not compressed even if a Compression profile is assigned.

If the two features need to be used together, the content modification and the compression must be positioned on separate vServices.

The compression processing load is not limited

No automatic processor usage limit is applied for compression. Since high levels (7–9) can lead to a noticeable processor load in heavy traffic, the system resources must be monitored after the level is increased.

Operational Best Practices ​

  • Do not target the content that is already compressed. Images (JPEG, PNG, GIF), videos and PDF files are already compressed formats; adding them leads to unnecessary CPU usage.
  • Focus on text-based content. HTML, CSS, JavaScript, JSON, XML and plain text are the types that benefit the most from compression.
  • The CPU usage is monitored. High levels (7-9) increase the CPU usage considerably; in high-traffic environments, the most suitable level is determined by following the metrics.
  • No change is made without the "Used in" information being checked. A profile must not be updated without knowing on which vServices it is used in the live environment.
  • Offloading is used carefully. If the Backend Service already performs sufficient compression, Offloading is not enabled on TR7.
  • Take the client compatibility into account. GZIP is supported in almost all browsers; DEFLATE is less common.
  • While Compression and Cache Are Used Together. Uncompressed content is written to the cache; every response served from the cache is compressed again. For this reason, the cache saves bandwidth but does not eliminate the compression processing load.

Supported vService Types ​

HTTP
L7 TCP
Network

How to Add? ​

A new Compression Profile is added through the TR7 web management interface with the steps below:

  1. The Configuration Menu is opened by clicking the TR7 logo at the bottom left.
  2. The Load Balancer → Profiles → Compression → Add steps are followed.
  3. A unique and descriptive name is entered for the profile.
  4. The values suitable for the application requirements are configured.
  5. The profile is added by clicking the Add button.

TIP

Instead of navigating the menu step by step, the related page is reached directly by using the search bar in the bottom left corner of the screen. The search bar opens with the Alt + T shortcut on Windows and Opt + T on macOS; typing the name of the feature being searched for is then sufficient.

The created profile can be used on one or more vServices.

Profiles Listing Screen ​

By following the Load Balancer → Profiles → Compression path, the list of all the Compression Profiles added on the TR7 device is reached. Profile adding, editing and deleting operations are performed through this screen.

Compression Profiles Listing FormCompression Profiles Listing Form

The table opens with the following columns by default:

ColumnDescription
NameThe name of the profile.
Compression AlgorithmThe compression algorithm: GZIP or DEFLATE.
File TypesThe number of content types to be compressed, in the Total of N form; the full list appears in the tooltip when the cell is hovered over.
Compression LevelThe compression level, in the Level N form; if no level is selected, Default.

There is no column hidden by default; these four columns are in the column selector. The table is not sorted when it opens; when a column header is clicked, descending sorting is applied first, then ascending, and on the third click the sorting is removed.

The items in the toolbar are arranged from left to right in the following order; the last two items (Page Information and Page Size) are located in the information strip below the table.

Columns ​

Which columns will be shown in the table is selected; all four columns are on by default. In the same panel, the columns are reordered by dragging and the alignment is selected per column; with the Fit rows to the page button the row height is fitted to the page, and with the Reset button the column layout is returned to the default. The layout is stored on a user basis.

Filter ​

The Filter button is used to filter the profiles shown in the list according to certain criteria; the button shows the number of active filters with a badge. There are three cards in the strip: Compression Algorithm, Compression Level and Used in. In the card title there are the filter name and the number of values; when the card is clicked, the values are listed under it with their row counts and more than one value can be selected together. The selections are displayed as closable labels under the card strip, right above the table.

The Used in card lists the names of the vServices on which the profile is used; for the profiles that are not used on any vService, the Unused Entries option is available. By clicking the editing icon on the left of the strip, the card editing mode is opened; in this mode the cards are reordered by dragging, renamed or removed from the strip.

Export ​

The table is exported as Excel, CSV or PDF by clicking the Export button. In the window that opens, the Filename, Format and Data Source, together with the Columns to be exported, are determined; the remaining fields are displayed according to the format: CSV Separator for CSV, Excel Sheet Name for Excel, and Page Orientation and Page Size for PDF.

Add ​

By clicking the Add button, the form for creating a new profile opens in the Add tab.

Delete ​

When one or more profiles are selected and the Delete button is clicked, the related profiles are deleted.

WARNING

A profile that is in use can also be deleted and the confirmation window does not show the usage places. On the vServices that use the deleted profile, compression is silently turned off; there is no return to the default profile. Before deleting, the Used in tab on the preview panel must be checked.

Edit ​

By clicking the Edit button, the edit form of the selected profile opens in the Edit tab. The button becomes enabled only when a single profile is selected.

Used to search all information in the table.

Used to search all information in the table with a regular expression (RegExp). This button is hidden while column-based search or the usage filter is active.

Used to perform a column-based search on the information in the table.

Usage Filter ​

Used to filter which vServices the profiles are bound to; the profiles used on the selected vService are listed, and there is an Unused Entries option for those not used on any vService. While the filter is active, the selector takes the place of the search box; when the icon is clicked again, the search box returns.

Page Information ​

Contains information about the total number of defined profiles and the number of profiles displayed in the list: Showing N-M of T records and the number of selected profiles (N selected, or Nothing selected when there is no selection). If a selection has been made in the filter strip, the number of applied filters and the shown/total row information are added to the same line.

Page Size ​

The maximum number of profiles to be displayed on the page is selected. The default is 20; the options are 5, 10, 20, 50, 100, 200, 500 and All.

Right-Click Menu ​

When a row is right-clicked, a menu with the profile's name in its title opens. Both operations in the menu apply only to the right-clicked profile; a selection made in the list does not affect the menu.

OperationWhat it does
EditOpens the editing form of the profile in the Edit tab; it is the same as the form opened by the Edit button in the toolbar.
DeleteDeletes the right-clicked profile; the same confirmation question as the deletion in the toolbar is displayed.

Preview of the Selected Profile ​

When a row in the list is clicked, the preview of the profile opens on the right of the screen; when the selected row is clicked again, the panel closes. In the title there are the profile icon, the name of the profile and the Compression profile subtitle, and at the top right there is a single operation.

Preview of the Selected ProfilePreview of the Selected Profile

OperationWhat it does
EditOpens the editing form of the profile in the Edit tab.

The panel has three tabs; the last one is displayed only if there is a vService that uses the profile:

Details

Lists the settings of the profile line by line (the table below).

Log

Lists the user operations on the profile (adding, editing, deleting) as a timeline.

Used in

Lists the vServices on which the profile is used. The badge next to the tab name shows the number of usages; if there is no vService that uses the profile, the tab is not displayed at all.

The rows in the Details tab are as follows, in order:

RowDescriptionVisibility condition
NameThe name of the profile.Always
Compression AlgorithmGZIP or DEFLATE.Always
File TypesThe full list of the content types to be compressed.Always
Compression LevelLevel N or Default.Always
OffloadingYes.Only while it is on

The "Used in" tab must be checked ​

The Used in tab shows on which vServices the profile is active. Since updates to the profile settings in a live environment will immediately affect all bound services, evaluating the possible service impacts before a change is critically important.

Profile Add Form ​

A new Compression Profile is added on the TR7 device by following the Load Balancer → Profiles → Compression → Add steps.

Compression Profile Add FormCompression Profile Add Form

INFO

Name Required ​

A unique name is entered for the profile to be created.

INFO

Compression Algorithm Default: GZIP ​

The algorithm to be used in the compression operation is selected.

DEFLATE
Alternative
An alternative algorithm to GZIP. It can show better performance in some scenarios.
  • Less header overhead
  • Client support is more limited
  • The HTTP Content-Encoding: deflate

INFO

Compression Level Default: Default ​

At the beginning of the list there is the Default option, followed by the Level 1 – Level 9 options. When Default is selected, the level is not written to the configuration at all and the engine’s own default is valid. In the form, a newly created profile comes with Default; the built-in default profile, on the other hand, uses Level 1.

A level change restarts the service

The compression level is a setting written to the general configuration of the vService. A change made in this field cannot be applied with an uninterrupted refresh; during saving, the related load balancer service is automatically restarted and a short interruption occurs. The changes in the other fields are applied without interruption.

It determines the balance between the compression ratio and the CPU usage.

LevelCompression RatioCPU UsageUse Case
1-3LowLowHigh-traffic, CPU-critical environments
4-6MediumMediumGeneral use, balanced performance
7-9HighHighBandwidth-critical, low-traffic environments

INFO

Offloading Default: Disabled ​

When it is activated, the compression configuration of the Backend Service is overridden and the operation is carried out entirely on TR7. It is used in order to apply a consistent compression policy.

INFO

File Types Default: text/plain ​

The field is a free text entry and defining at least one type is required. While writing, a suggestion list opens; the list starts with text types such as text/html, text/plain, text/css and text/javascript and continues with image, audio, video and archive types; however, it does not contain the types recommended to be compressed, such as application/json, application/xml and application/javascript; these types must be written manually.

It defines the content types (MIME types) to be compressed.

The File Types SelectionThe File Types Selection

The MIME types that are commonly compressed:

MIME TypeContent
text/htmlHTML pages
text/cssCSS files
application/javascript, text/javascriptJavaScript files
application/jsonJSON responses
application/xml, text/xmlXML content
text/plainPlain text files

Which file types are not included? ​

Do not add the formats that are already compressed (JPEG, PNG, GIF, PDF, ZIP, etc.) to the list. These types do not benefit from compression and cause unnecessary CPU usage.

INFO

Add ​

The profile adding process is completed by clicking the Add button.

How to Add to a vService? ​

A Compression Profile is assigned to a vService by following the steps below.

1
Step 1 Go to the vServices screen

The Load Balancer → Load Balancer vService List path is followed in the TR7 web interface.

2
Step 2 Open the editing screen of the vService

The vService to which the profile will be added is right-clicked and Edit is selected; or the vService is clicked and the Edit icon is clicked in the window that opens on the right.

3
Step 3 Enable the Compression feature

On the Details panel on the right of the editing screen of the vService, the feature is put into effect by marking the Compression option. On the first activation, Default Profile comes selected.

The Compression Selection on the vService Editing ScreenThe Compression Selection on the vService Editing Screen

4
Step 4 Select a profile or add a new one

In order to use a profile other than Default Profile, the arrow sign next to the row is clicked and a selection is made from the added profiles in the list in the expanding section.

If desired, a new profile can also be added through the vService editing screen by clicking the Add button.

5
Step 5 Save

The changes are saved by clicking the Save button; while the configuration is being applied to the vService, the "vService is being edited" notification is displayed.