tencent cloud

Feedback

Follow 301/302 Configuration

Last updated: 2022-04-01 10:14:01

    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.
    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 avaliable.

    7x24 Phone Support