tencent cloud

All product documents
Content Delivery Network
Follow 301/302 Configuration
Last updated: 2024-12-30 21:37:16
Follow 301/302 Configuration
Last updated: 2024-12-30 21:37:16

Configuration

Tencent Cloud CDN does not cache 301/302 status codes by default. When an origin server returns a 301/302 request, the CDN node will return the response to the client by default, and the client will be redirected to the corresponding resource for access.
When the follow 301/302 redirect configuration is enabled, the CDN node will be redirected when receiving a 301/302 redirect request during origin-pull until it gets the required resource (up to 3 follows are supported). It will then return the actual resource to the client, which does not need to be redirected.

Configuration Guide

Log in to the CDN Console, select Domain Management on the left sidebar, and click Manage to the right of the domain name to access its configuration page. Under the Origin Configuration tab, find Follow 301/302 Configuration, which is disabled by default:



Configuration Sample

Suppose the follow 301/302 redirect configuration for the domain name cloud.tencent.com is as follows:

User A requests a resource http://cloud.tencent.com/1.jpg. If the cache is not hit on the node, the node will request the resource from the origin server. If the HTTP response status code returned by the origin server is 302 and the redirect address is http://cloud.tencent.com/1.jpg, then:
1. After follow 301/302 redirect is enabled, the node will directly initiate a request to the redirect address when it receives the HTTP response with the 301/302 status code.
2. The resource will be obtained, cached to the node, and returned to the user.
3. At this time, if user B also sends a request for http://cloud.tencent.com/1.jpg, the cache will be hit on the node and the resource will be returned to the user.
4. After follow 301/302 redirect is enabled, up to 3 follows are allowed. If this limit is exceeded, the 301/302 status code will be returned to the user.
Suppose the follow 301/302 redirect configuration for the domain name cloud.tencent.com is as follows:

User A requests a resource http://cloud.tencent.com/1.jpg. If the cache is not hit on the node, the node will request the resource from the origin server. If the HTTP response status code returned by the origin server is 301/302 and the redirect address is http://xxx.tencent.com/1.jpg, then:
1. The node will directly return the HTTP response to the user.
2. When the user initiates a request for http://xxx.tencent.com/1.jpg, no acceleration will take effect if the domain name is not connected to CDN.
3. At this time, if user B also sends a request for http://cloud.tencent.com/1.jpg, the process above will be repeated.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon