Prefetch URLs
Last updated Aug 14, 2026 URL prefetching means that Cloudflare pre-populates the cache with content a visitor is likely to request next. This setting — when combined with additional setup — leads to a higher cache hit rate and thus a faster experience for the user.
Availability
| Free | Pro | Business | Enterprise | |
|---|---|---|---|---|
| Availability | No | No | No | Yes |
Setup
For Cloudflare to start prefetching URLs, you will need to enable the feature and include a list of URLs to prefetch.
Enable Prefetch URLs
To enable Prefetch URLs in the dashboard:
- In the Cloudflare dashboard, go to the Speed > Settings page. Go to Settings ↗
- Go to Content Optimization.
- For Prefetch URLs, switch the toggle to On.
To enable or disable Prefetch URLs with the API, send a PATCH request with prefetch_preload as the setting name in the URI path, and the value parameter set to your desired setting ("on" or "off").
Choose URLs to prefetch
After you enable the feature, you also need to indicate which URLs Cloudflare should prefetch.
To do this, include a Link HTTP response header pointing to a manifest file with the rel="prefetch" attribute and then serve the manifest file with text/plain as the Content-type response header.
Example HTTP response header:
Link: <http://www.example.com/manifest.txt>; rel="prefetch"
Example manifest.txt file:
/static/fetch1
//other.example.com/fetch2
http://another.example.com/fetch3
The manifest file should contain URIs, protocol-relative URLs or full URLs, separated by new lines. These files must be on your websites that are on Cloudflare. If you reference HTML pages, only the HTML page itself will be pre-fetched - any sub-requests from that HTML will not be fetched unless they are also defined explicitly in your manifest.
Note
The IP address used to make the prefetch request to the manifest file is logged as 127.0.0.1 in your Cloudflare logs.
Prefetch files limits
The prefetch files limits are the following:
- The maximum number of manifest files is 16.
- The maximum number of files per manifest file is 100.
- A manifest file has a size limit of 1 MB.
Limitations
- Cloudflare will only prefetch files listed in the manifest file if the resources are those cached by default.
- Prefetch is not compatible with the custom cache key configuration. For more information, refer to Cache Key limitations.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/speed/optimization/content/prefetch-urls/#page","headline":"Prefetch URLs","description":"Prefetch URLs to load resources before visitors request them.","url":"https://developers.cloudflare.com/speed/optimization/content/prefetch-urls/","inLanguage":"en","image":"https://developers.cloudflare.com/speed/optimization/content/prefetch-urls/og.png?v=b6e774ff587d37ce","dateModified":"2026-08-14","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["Caching"]}
description: Defer JavaScript loading to improve page rendering speed. title: Rocket Loader image: https://developers.cloudflare.com/speed/optimization/content/rocket-loader/og.png?v=52b24c1759abca0b
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/speed/llms.txt
Use this file to discover all available pages before exploring further.
Docs