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.
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:
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:
http://cloud.tencent.com/1.jpg
, the cache will be hit on the node and the resource 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:
http://xxx.tencent.com/1.jpg
, no acceleration will take effect if the domain name is not connected to CDN.http://cloud.tencent.com/1.jpg
, the process above will be repeated.
Was this page helpful?