tencent cloud

Feedback

Cache Purge

Last updated: 2024-03-21 09:29:50

    Overview

    When your resource content is cached to the EdgeOne edge node, during the cache validity period, users accessing the resource will be directly responded by the EdgeOne edge node without triggering a return to the origin. If your origin site updates the resource content at this time, in order to prevent users from still accessing the old resource files, you can manually clear the cached resources in all edge nodes by using the Cache Purge function. After the cache is cleared, when users access the resource, EdgeOne will follow the origin to obtain the latest resource for response.

    Quota Description

    Different billing plans have different quotas, please refer to: Comparison of EdgeOne Plans.

    Use Cases

    You may need to use this function in the following scenarios:
    Content update: When you have updated some resources on the origin, but the cache on EdgeOne has not expired, you may want to let the client user see the latest content immediately.
    Error fix: If there are some erroneous contents cached on EdgeOne from your origin, to avoid business risks, you need to purge these erroneous caches immediately to ensure that EdgeOne no longer provides the wrong content.
    Testing and debugging: When developing and debugging a website, you may need to frequently modify and test the content. To ensure that you see the latest modified content rather than the cached old version, you can use the clear the cache function.
    Emergency response: In some emergency situations, such as being attacked or releasing sensitive information, you need to remove the relevant content from EdgeOne immediately.
    Cache Rules adjustment: When you adjust or optimize the EdgeOne Cache Rules, you may need to purge the existing cache to ensure that the new Rules are Effective immediately.

    Support Type

    EdgeOne clear the cache support based on various types of purging, details as follows:
    Type
    Details
    URL
    Match the node cache resources of the URL, for example, https://www.example.com/path/foo.jpg.
    Directory
    Match the node cache resources of the directory, for example, https://www.example.com/path/.
    Hostname
    Match the node cache resources of the Hostname, for example, www.example.com. Do not support submitting URLs in the format of *.test.com, that is, the domain name cannot contain wildcards, and the corresponding subdomains need to be specified.
    Cache-Tag
    Purge the cache by matching the tag value (tags) in the Cache-Tag response header of the HTTP response packet, for example, Cache-Tag: tag1,tag2,tag3.
    Only applicable to the Enterprise plan.
    EdgeOne supports identifying the Cache-Tag in the origin response headers, please add tag(s) to this header:
    The maximum header size is 6KB.
    Multiple tags are separated by ",", a single tag does not exceed 128 characters, and the tag limitation is 1,000.
    Tags are case-insensitive, that is, Tag1 and tag1 will be recognized as the same tag.
    All Cache
    All cache resources of the site on the node.
    If a wildcard domain name (e.g., *.foo.example.com) is connected to the current site (example.com), it is unable to take effect against all caches under the wildcard domain name. You need to submit separate tasks to clear the cache for each specific subdomain.
    EdgeOne Cache Purge is divided into direct deletion and mark as expired methods, as follows:
    URL Type and Cache-Tag Type are set to "directly delete" by default, which means directly deleting the cache content. When a user sends a request for resources, EdgeOne will immediately origin-pull the latest resources, increasing the number of origin-pull requests within a short time and weakening the acceleration effect. If a large amount of content is submitted, the origin will be under greater pressure.
    Other purge types are set to "mark as expired" by default, which means that the cache will not be directly deleted, but marked as expired. If the cache node has Last-Modified and Etag headers, the next time a user requests the resource, the node will carry If-None-Match and If-Modified-Since headers for origin-pull verification whether the resource has been updated. The response of 304 or 200 is determined by the origin, generally speaking:
    If there is no update - the origin returns 304 (Not Modified), then the node continues to use the cache to respond, effectively saving bandwidth;
    If there is an update - the origin returns 200 (OK), then the node collects the latest resources from the origin and compares the Last-Modified and Content-Length headers of the cached resources and the new resources. If either header value is different, the new resource will overwrite the expired cache on the node.
    Note:
    EdgeOne nodes differentiate cache based on the URL before and after encoding by default. Therefore, when refreshing, you need to submit them separately. If the URL contains special characters, then when submitting the URL refresh in the console:
    https://example.com/d/default_avatar.png?x-oss-process=image/resize,w_600,1_800, the cache corresponding to the URL before encoding will be refreshed;
    https://example.com/d/default_avatar.png?x-oss-process=image%2Fresize%2Cw_600%2C1_800, the cache corresponding to the URL after encoding will be refreshed.

    Directions

    Scenario One: Clear cache by entering content

    If you have a small amount of content to clear and it is convenient to enter the content directly in the input box, you can follow these steps:
    1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you want to configure in the site list.
    2. In the site details page, click on Site Acceleration > Cache Purge.
    3. On the Cache Purge page, select the resource type you want to clear, enter the corresponding resource content, and click OK.
    
    4. Switch to the History Records tab to view the history records of the specified time range (within the last month) and purge type.

    Scenario Two: Clear cache by uploading a file for batch import

    If you have a large amount of content to clear or have already placed the content in a file, you can choose to upload the file:
    1. Log in to the EdgeOne console, click on the site list in the left menu bar, and click on the site you want to configure in the site list.
    2. In the site details page, click on Site Acceleration > Cache Purge.
    3. On the Cache Purge page, select the resource type you want to clear, choose the "Upload File" method, upload the file, and click OK.
    
    4. Switch to the History Records tab to view the history records of the specified time range (within the last month) and purge type.

    Related References

    
    
    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