I've turned on "Full Page Caching" to "On - In all cases" under "Cache & Speed Settings" and tested it by clearing cache and loading my home page in a separate browser. But it seems the load time seems to remain the same no matter how many times I refreshed the browser, leading me to believe that the CMS is still going to the DB to retrieve the page, instead of from the cache.
I managed to track the codes down to specifically this bit inside /concrete/src/Cache/Page/PageCache.php
/**
* Note: can't use the User object directly because it might query the database.
* Also can't use the Session wrapper because it starts session which triggers
* before package autoloaders and so certain access entities stored in session
* will break.
*/
public function shouldCheckCache(Request $req) {
$session = \Config::get('concrete.session.name');
$r = \Cookie::get($session);
if ($r) {
return false;
}
return true;
}
If I force this function to always return true, I will find that subsequent reloads of the browser see a much shorter load time, which I believe shows that the page is retrieved from the cache.
The function seems to check if the "CONCRETE5" cookie has been set. If so, then the cache will be ignored. I don't really understand what this all means, so hope someone can help shed some light on whether I'm doing something wrong, or what I should do instead.
Thank you for any help!