Does Cloudflare Do Prefetching?

Does Cloudflare Do Prefetching?

Yes. Enterprise customers can enable prefetching by turning on 'Prefetch URLs' in the Speed app of the Cloudflare dashboard, and including a list of URLs to prefetch in HTML headers.

What is Prefetching?

Prefetching means that Cloudflare pre-populates the cache with content a visitor is likely to request next. This guarantees a higher cache hit rate and thus a faster experience for the user.

How do I use Cloudflare's prefetching feature?

To use Cloudflare's prefetching feature, you must:

1. Turn on the Prefetch URLs setting under the Speed app in the Cloudflare dashboard.

2. Include an HTTP header in the response that links to a list of URLs to prefetch.

Cloudflare will prefetch the files listed in a manifest file. The manifest file is found in a Link HTML header with the rel=”prefetch” attribute. 

Example HTTP response header:
Link: <>; rel="prefetch"

Example manifest.txt:

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. Note that 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 too are defined explicitly in your manifest.

What Content Can Be Prefetched?

Cloudflare can prefetch any content that is on your account and behind Cloudflare.

Who is Prefetching Available For?

Prefetching is available for all Enterprise customers. To upgrade to Enterprise, contact the Cloudflare team.

Still not finding what you need?

The Cloudflare team is here to help. 95% of questions can be answered using the search tool, but if you can’t find what you need, submit a support request.

Powered by Zendesk