How to cache completely a webpage within CF servers to speed up the pages without loading them twice

In order to increase the speed of my webpages, I created a Page Rule for some of my webpages (* mydomain.com/product/* ), with the following settings:

  • Browser Cache TTL: a month
  • Always Online: On
  • Cache Level: Cache Everything
  • Edge Cache TTL: a month

If I check the TTFB by using online tools like ‘bytecheck’ or ‘keyCDN tools’, I see always the same behaviour: the first check with the tool shows a TTFB of 300-400ms and the second one, only 50 ms. If I use first ‘bytecheck’, then I have to check twice with ‘keyCDN tools’ to see a fast TTFB.

Two questions:

  • I supposed that the cached version of the HTML code was stored in the CloudFlare servers, but it seems not. It seems that visitors must load the pages twice to cache them.
  • is there any method (CloudFlare API?) to cache the pages without forcing visitor to visit them twice in order to experience a fast TTFB?

That’s sort of normal. First request of an uncached file is standard speed. After that, it’s fast…until it gets kicked out of the cache for being too old or hardly used.

Sorry, no. It requires a request from geographic region before it’s loaded into the cache. Most of my sites have a local audience, so I periodically crawl my sites from my local servers.

so I periodically crawl my sites from my local servers.

If I understood you, you built a script to crawl your public website (e.g. 10,000 URLs) in order to make CloudFlare to cache them. Is it right?

And definitively there is no option to make CloudFlare to cache them automatically.

Thank you very much for your answer :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.