1

Cloudflare caches files with extension html for static content. But when visiting the root of a website, eg http://foo.com there is no extension specified, thus this page is not cached as static html. How can I tell Cloudflare to cache the homepage without an extension?

Obviously I could use Apache's htaccess to force traffic from http://foo.com to http://foo.com/index.html but that means my server will be hit to execute this redirect, and that's exactly what I want to avoid.

1

1 Answer 1

0

You simply use the explicit url as the page rule. Such as http://foo.com/.

5
  • But then everything will be cached, including all pages that fall under foo.com/blaba etc. Commented Jan 22, 2018 at 8:15
  • @bart that is incorrect. Only a wildcard rule would do that, such as foo.com/* Commented Jan 23, 2018 at 0:01
  • Also @bart - cloiudflare does not cache pages as static content. Even HTML. Unless you explicitly do so with a page rule. This is because any file extension can be driven through a pre processor on the server depending on the configuration. Commented Jan 23, 2018 at 0:05
  • Fair enough, but question remains, will a page rule at root level be applied to all subfolders? Commented Jan 23, 2018 at 23:20
  • If you use the wildcard character, yes: foo.com/* Commented Jan 24, 2018 at 0:53

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.