Reputation: 699
I am interested to link Moodle with Cloudflare, but I would like to know how it works. I understand how Cloudflare works but if your website is like moodle that is private. How can create a cache of a page that is private? It's possible a basic question but i would like to know the answer.
Upvotes: 1
Views: 1709
Reputation: 575
Cloudflare is able to cache any static resource, such as styles, images, and js. As your traffic is routed through Cloudflare as you need to use their domain name servers, then even if these resources are behind a login, so long as the paths themselves are not protected then these resources have the potential to be cached by the Cloudflare CDN.
For example, your theme plugin will have many resources js, css, logo graphics, etc, that are accessible to anyone with the full URL. So these can be served via the CDN, regardless of if the page the user is loading is behind a login or not. Now, if the content of the page is dynamic, i.e. generated only if the user has access (and may even change depending on the rights and privileges of that user), then the CDN will not be able to cache this content.
This is not anything specific to Moodle, or even Cloudflare per se. WordPress or any other CMS that generates dynamic content would have the same constraints.
and a useful community thread: https://community.cloudflare.com/t/cloudflare-with-private-pages-membership-site/20289
Moodle forum thread on the topic in general (behind login) https://moodle.org/mod/forum/discuss.php?d=317981
Upvotes: 1