tencent cloud

Tencent Cloud EdgeOne

Release Notes and Announcements
Release Notes
Security Announcement
Announcements
Product Introduction
Overview
Strengths
Use Cases
Comparison Between EdgeOne and CDN Products
Use Limits
Purchase Guide
Description of Trial Plan Experience Benefits
Free Plan Guide
Billing Overview
Billing Items
Subscriptions
Renewals
Instructions for overdue and refunds
Comparison of EdgeOne Plans
About "clean traffic" billing instructions
DDoS Protection Capacity Description
Getting Started
Choose business scenario
Quick access to website security acceleration
Quick deploying a website with Pages
Domain Service&Origin Configuration
Domain Service
HTTPS Certificate
Origin Configuration
Site Acceleration
Overview
Access Control
Smart Acceleration
Cache Configuration
File Optimization
Network Optimization
URL Rewrite
Modifying Header
Modify the response content
Rule Engine
Image&Video Processing
Speed limit for single connection download
DDoS & Web Protection
Overview
DDoS Protection
Web Protection
Bot Management
API Discovery(Beta)
Edge Functions
Overview
Getting Started
Operation Guide
Runtime APIs
Sample Functions
Best Practices
Pages
L4 Proxy
Overview
Creating an L4 Proxy Instance
Modifying an L4 Proxy Instance
Disabling or Deleting an L4 Proxy Instance
Batch Configuring Forwarding Rules
Obtaining Real Client IPs
Data Analysis&Log Service
Log Service
Data Analysis
Alarm Service
Site and Billing Management
Billing Management
Site Management
Version Management
General Policy
General Reference
Configuration Syntax
Request and Response Actions
Country/region and Corresponding Codes
Terraform
Overview
Installing and Configuring Terraform
Practical Tutorial
EdgeOne Skill User Guide
Automatic Warm-up/Cache Purge
Resource Abuse/hotlinking Protection Practical
HTTPS Related Practices
Acceleration Optimization
Scheduling Traffic
Data Analysis and Alerting
Log Platform Integration Practices
Configuring Origin Servers for Cloud Object Storage (Such As COS)
CORS Response Configuration
API Documentation
History
Introduction
API Category
Making API Requests
Site APIs
Acceleration Domain Management APIs
Site Acceleration Configuration APIs
Edge Function APIs
Alias Domain APIs
Security Configuration APIs
Layer 4 Application Proxy APIs
Content Management APIs
Data Analysis APIs
Log Service APIs
Billing APIs
Certificate APIs
Origin Protection APIs
Load Balancing APIs
Diagnostic Tool APIs
Custom Response Page APIs
API Security APIs
DNS Record APIs
Content Identifier APIs
Legacy APIs
Ownership APIs
Image and Video Processing APIs
Multi-Channel Security Gateway APIs
Version Management APIs
Data Types
Error Codes
FAQs
Product Features FAQs
DNS Record FAQs
Domain Configuration FAQs
Site Acceleration FAQs
Data and Log FAQs
Security Protection-related Queries
Origin Configuration FAQs
Troubleshooting
Reference for Abnormal Status Codes
Troubleshooting Guide for EdgeOne 4XX/5XX Status Codes
520/524 Status Code Troubleshooting Guide
521/522 Status Code Troubleshooting Guide
Tool Guide
Agreements
Service Level Agreement
Origin Protection Enablement Conditions of Use
TEO Policy
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Smart Compression

PDF
Focus Mode
Font Size
Last updated: 2025-07-29 09:36:33

Function Introduction

EdgeOne enables Gzip or Brotli compression globally by default. When the client request header carries Accept-Encoding: br, gzip or Accept-Encoding: br or Accept-Encoding: gzip, the node will intelligently compress files based on their Content-Type. Compressed files can effectively reduce the size of resources and speed up content transmission. Enabling smart compression can help you:
1. Improve user experience: By reducing resource size, web page loading speed can be significantly improved, providing a better user experience. Especially for websites with a large amount of CSS, JavaScript, and other resources, enabling compression can greatly reduce loading time.
2. Save traffic: Compressed resources will consume less network traffic, which will help reduce operational costs.

Directions

Note:
By default, you do not need to modify this configuration. If in some scenarios, such as: the current client will perform MD5 verification on the file or the current client does not support parsing the specified compressed file, and you want the current site to use only Brotli compression or Gzip compression, or not to compress at all, you can follow the steps below.

Scenario 1: Enable/Disable Smart Compression for All Domain Names of the Site

If you need to enable/disable smart compression for the whole connected site, please refer to the following steps:
1. Log in to the Tencent Cloud EdgeOne console, enter Service Overview in the left menu bar, and click the site to be configured under Website Security Acceleration.
2. On the site details page, click Site Acceleration to enter the global site configuration page. Then click File Optimization in the right sidebar.
3. Find the smart compression configuration card, which is enabled by default. Click the switch to configure enable/disable.


Scenario 2: Enable/Disable Smart Compression for Specific Domain Names

If you only need to enable/disable smart compression for specific domain names, please refer to the following steps:
1. Log in to the Tencent Cloud EdgeOne console, enter Service Overview in the left menu bar, and click the site to be configured under Website Security Acceleration.
2. On the site details page, click Site Acceleration to enter the global site configuration page. Then click the Rule Engine tab.
3. On the rule engine management page, click Create rule and select Add blank rule.
4. On the rule editing page, select the Host matching type to match requests for specific domain names.
5. Click Action > Select Box, and in the pop-up operation list, select the operation as Smart Compression, and click the switch to enable/disable Gzip or Brotli compression.

6. Click Save and Publish to complete the rule configuration.

Related References

Smart Compression Effective Rules

1. Smart compression supports file size range:256B - 30MB。
2. Smart compression is synchronous compression, compressing files while fetching them from the origin. When the node first requests a compressed file, it can directly respond with the compressed file.
3. Smart compression compresses files based on Content-Type by default, supporting the following types:
text/html
text/xml
text/plain
text/css
text/javascript
application/json
application/javascript
application/x-javascript
application/rss+xml
application/xmltext
image/svg+xml
image/tiff
text/richtext
text/x-script
text/x-component
text/x-java-source
text/x-markdown
text/js
image/x-icon
image/vnd.microsoft.icon
application/x-perl
application/x-httpd-cgi
application/xml
application/xml+rss
application/vnd.api+json
application/x-protobuf
multipart/bag
multipart/mixed
application/xhtml+xml
font/ttf
font/otf
font/x-woff
application/vnd.ms-fontobject
application/ttf
application/x-ttf
application/otf
application/x-otf
application/truetype
application/opentype
application/x-opentype
application/font-woff
application/eot
application/font
application/font-sfnt
application/wasm
application/javascript-binast
application/manifest+json
application/ld+json
4. If you have both Gzip and Brotli compression enabled at the same time, and the client request header Accept-Encoding carries both br and gzip:
If the node already has cached content, it will respond according to the following rules:
If the node has both Brotli and gzip compressed cache content, it will prioritize responding with Brotli compression.
If the node only has Brotli compressed cache content, it will prioritize responding with Brotli compression.
If the node only has gzip compressed cache content, it will prioritize responding with Gzip compression.
If the node does not have cached content, it will prioritize responding with Brotli compression.
5. When only Brotli compression is enabled, if the request compression header is gzip, the compression will not take effect, and the original resources will be returned; when only Gzip compression is enabled, if the request compression header is br, the compression will not take effect, and the original resources will be returned.
6. If the origin server has enabled compression and the server carries response headers: Content-Encoding, the smart compression function will no longer be effective.

Request Example

Not Enabled Smart Compression First request for gzip compressed file, not hit node cache, fetch the original file from the origin and cache it to the node, EdgeOne responds with the original file:

Enabled Smart Compression
First request for gzip compressed file, not hit node cache, fetch the file from the origin, node synchronously compresses and caches the compressed file, EdgeOne responds with the compressed file:
Smart compression supports streaming compression, and if the request does not hit the node cache, it will respond in a chunked manner after fetching the file from the origin.

Subsequent requests, hit the node cache of gzip compressed file, the node directly responds with the compressed file.



Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback