All Products
Search
Document Center

Edge Security Acceleration:Prefetch cache

Last Updated:Aug 19, 2025

The prefetch feature of Edge Security Acceleration (ESA) proactively caches resources from an origin server to its nodes. This allows ESA to serve resources directly from a node when they are requested for the first time, instead of retrieving them from the origin server. This feature increases the cache hit ratio.

Scenarios

  • Operational activities

    When you run a large-scale promotional campaign, you can prefetch the static resources of the campaign page to ESA nodes. This ensures that after the campaign starts, all static resources are served directly from the ESA acceleration nodes.

  • Installation package releases

    Before you release a new version or an upgrade package, you can prefetch the resources to ESA acceleration nodes. After the product is published, download requests from many users are served directly by the ESA acceleration nodes. This improves download speeds, significantly reduces the load on the origin server, and enhances the user experience.

Prefetch methods

ESA supports two methods: Instant Prefetch and Scheduled Prefetch.

  • Instant Prefetch: An instant prefetch task starts immediately after you submit the URLs. This method lets you quickly cache resources on ESA nodes.

  • Scheduled Prefetch: A scheduled prefetch task runs at a specified time and frequency. This helps you avoid business peak hours, control back-to-origin traffic from prefetching, and reduce the load on your origin server.

Precautions

  • After you submit a prefetch task and it runs successfully, ESA nodes immediately retrieve the required resources from the origin server. Submitting many instant prefetch tasks at once can create many concurrent download tasks. This may cause a surge in back-to-origin traffic and requests, which increases the load on your origin server. You can use the scheduled prefetch feature to avoid this issue.

  • The running time of a prefetch task depends on the size of the files to be prefetched. A task typically takes 5 to 30 minutes to complete. The smaller the average file size, the faster the prefetch speed.

  • By default, prefetch requests include the Accept-Encoding:gzip header. To include other headers in prefetch requests or implement multi-replica prefetching, use the OpenAPI operation PreloadCaches. You can set the Header request parameter to specify custom prefetch headers.

  • During a prefetch task, if the origin server returns a redirect status code, such as 301, the task fails because it does not follow the redirection. If your origin server returns a 301 or 302 status code, you must contact us to enable the origin-fetch 301/302 redirect feature.

  • When you submit URLs to prefetch, if a URL contains non-ASCII characters, such as spaces, Chinese characters, or other special characters, you must URL-encode the URL first. Otherwise, the content management system cannot recognize the task. Make sure that you submit URLs in the encoded format.

Procedure

  1. In the ESA console, choose Websites. In the Website column, click the name of the target site.

  2. In the navigation pane on the left, choose Caching > Prefetch Cache.

  3. Select a prefetch method. ESA supports Instant Prefetch and Scheduled Prefetch.

    Instant prefetch

    An instant prefetch task starts immediately after you submit the URLs. This method lets you quickly cache resources on ESA nodes.

    You can submit URLs using Manual Input or Upload File.

    Refreshing the input method

    Description

    Manual Input

    Enter the URLs to prefetch in the input box, and then click Submit. The URL must be the full path to the file. Enter one URL per line. You can enter a maximum of 100 URLs at a time. For example:

    https://www.example.com/cat.jpg
    https://www.example.com/image/cat.jpg

    Upload File

    If you have many URLs to prefetch, add them to a TXT file and upload the file for a batch prefetch. The URL must be the full path to the file. Enter one URL per line. The TXT file cannot exceed 10 MB in size.

    Scheduled prefetch

    A scheduled prefetch task runs at a specified time and frequency. This helps you avoid business peak hours, control back-to-origin traffic from prefetching, and reduce the load on your origin server.

    1. Create a TXT file and add the URLs to prefetch. The URL must be the full path to the file. Enter one URL per line. The TXT file cannot exceed 10 MB in size.

    2. Click Create Prefetch Task.

    3. Enter a custom name for the prefetch task, upload the file, and then click Next.

      Note

      You can create a maximum of 100 prefetch tasks.

      image

    4. Create a prefetch plan. You can set the prefetch time period, submission interval (minimum 1 second), and batch size (maximum 100 URLs) as needed.

      Note

      You can create a maximum of 10 prefetch plans.

      image

    5. Click OK.

  4. View the prefetch progress.

    After you submit a prefetch task, you can view the detailed records and progress of the resource prefetch on the Prefetch Records tab. A progress of 100% indicates that the prefetch task is complete. The task may take longer to complete if it includes many files.

Feature availability by edition

Refreshing

Entrance

Pro

Premium

Enterprise

URL Prefetch

1,000

50,000

100,000

500,000