Prefetch Content from Origin

Last update:2024-05-24 17:41:47

File prefetch refers to proactively fetching content from the origin server to CDN servers, which is particularly suitable for scenarios where there is no cached content on CDN servers or the cached content has expired, and customers do not want this to affect the access speed of their end users.

For example:
When there is no cache on CDN, and a user request reaches a CDN edge server, the CDN needs to request the content from the origin server. After CDN retrieves the content, it responds to the user. At this time, the user’s access speed is relatively slow because it needs to wait for the CDN to fetch the file from the origin server.
If the customer has used the file prefetch feature in advance, the CDN will proactively fetch and cache the file from the origin server. Then, when a user request reaches the CDN edge server, it will immediately respond without waiting for the CDN to fetch the file, significantly increasing the user’s access speed.
From the perspective of the origin server, file prefetch also reduces the number of CDN back-to-origin requests, thereby alleviating the pressure on the origin server.

File prefetch is suitable for customers’ large-scale events, such as installation package release, game updates, etc. By prefetching resources to CDN before the event starts, even if there is a high volume of concurrent user requests after the event starts, it will not affect the users’ access speed or the load on the origin server.

How to Create a File Prefetch Task

  1. Before creating a task, please ensure that you have purchased CDNetworks’ CDN product, configured acceleration services for your domain, and contacted CDNetworks technical support to enable file prefetch permissions.
  2. Log in to the CDNetworks Console, find in the left menu: Products > Application Services > Content MGMT > File Prefetch, and click Create Task.
  3. Set up the file prefetch task as needed.


URL Text Box
Enter the URL of the file you want to prefetch as needed.

  • The domain of each URL must be under a domain that has acceleration service with CDNetworks.
  • Please enter only one URL per line, multiple URLs should be entered on new lines (up to 500 URLs allowed per task).
  • URLs must start with http:// or https:// and be specific, complete URLs, without support for regular expressions or directories. For example, http://www.a.com/image/test.png.
  • The maximum length of each URL is 2000 characters.
  • If a URL contains Chinese characters, the submitted URL must be the URL with Chinese characters escaped (using UTF-8 encoding).
  • The default limit for URLs allowed to be prefetched per day is no more than 20,000, and the total file size (also called prefetched space) is no more than 5000MB. If the number of URLs of existing tasks reaches 20,000 or the total file size reaches 5000MB, creating file prefetch tasks will not be allowed for the day. You can see the current remaining number of URLs and the remaining prefetch space on console. (If you have a lot of prefetch tasks and the current limit does not meet your needs, you can contact CDNetworks technical support to adjust the limit).

Prefetch Time

  • Immediate: The prefetch task is dispatched immediately after submission.
  • Reserve: Set a prefetch time. The task will not be dispatched immediately after submission but will wait until the preset time to dispatch.

How to Query File Prefetch Tasks

Log in to the CDNetworks Console, find in the left menu: Products > Application Services > Content MGMT > File Prefetch, and click Task Query. You can query file prefetch tasks by specifying time, domain, and URL. You will see the following information for the target task.


Task Status

  • run: In progress
  • success: Executed successfully
  • wait: Queuing
  • failure: Execution failed
  • cancel: Canceled
Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!