CDN Cache Purging

Last updated: 2020-07-13 11:38:40

    Overview

    CDN cache purging is a Tencent Cloud COS feature based on SCF to help users automatically purge their data cached on CDN edge servers. If you add a trigger rule to your bucket, then when you update files in the bucket, the SCF function provisioned by COS will be automatically triggered to purge your cached data.

    Note:

    • If you added a cache purging rule to your bucket in the COS Console, the resulting purging function will also appear in the SCF Console. DO NOT delete this function; otherwise, your rule may not take effect.
    • All regions where SCF has been available support CDN cache purging, including Guangzhou, Shanghai, Beijing, Chengdu, Hong Kong, Singapore, Mumbai, Toronto, and Silicon Valley. For more supported regions, see the SCF Documentation.
    • CDN cache purging may fail due to factors such as unstable network connection. In these cases, you can click View Log for the function you created in the COS console to open the SCF console where you can view the error log details for troubleshooting.
    • This feature depends on SCF which provides users with a free tier. You will be billed for the part exceeding the free tier according to SCF Product Pricing. The more often you use this feature, the more invocations you will consume in the free tier.

    Directions

    1. Log in to the COS Console.
    2. In the left sidebar, click Bucket List. Select the bucket for which to add a CDN cache purging rule to open the bucket management page.
    3. Click Function Service, and scroll down to the CDN Cache Refresh Function section.

      Note:

      If you haven’t activated the SCF service, you can do so by using the SCF Console, and enable SCF service authorization as instructed.

    4. Click Add Function, and configure the following in the pop-up window:
      • Function Name: uniquely identifies a function, and cannot be modified after creation. You can view the function from the SCF console.
      • Event Type: an operation that triggers the function. Taking upload as an example, an upload may be performed by calling the PUT Object or Post Object API. If you select PUT for Event Type, only uploads through the PUT Object API can trigger the function to purge your cache on CDN edge servers.
      • Trigger Condition: specifies the source file range for triggering the function. You can choose the whole bucket, or a range with specified prefix or suffix. If you choose the latter, the rule only applies to the matched source files.
      • Specified Domain: specifies the CDN domain to cache.
      • SCF Authorization: CDN cache purging requires authorizing SCF to call the CDN API PurgeUrlsCache. In this way, SCF can replace your CDN cache with the latest data CDN pulls from the origin server on COS.
    5. Click OK to add the function.
    6. You can view your CDN cache purging records by clicking View Log. To delete an unwanted CDN cache purging rule, simply click Delete.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help