maxf5 Posted June 16, 2018 Share Posted June 16, 2018 Hi guys, this just came into my mind if you have MarkUpCache / TemplateCache enabled. Is there a more elegant way than using a http request? in site/ready.php: <?php namespace ProcessWire; function PreLoadCache(HookEvent $e) { $all = wire()->pages->find("has_parent!=2|1139|1029"); // no admin pages, contact forms, page tables $s=0; $f=0; $fn = ''; $http = new WireHttp(); foreach($all as $a) { $response = $http->get($a->httpUrl); if($response !== false) { $s++; } else { $fn .= $a->title . ", "; $f++; } } wire()->log()->save('croncaching', 'Cached: '. $s .' Pages, Failed at '. $f .' Pages: '. $fn .''); } wire()->addHook('LazyCron::every12Hours', null, 'PreLoadCache'); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now