Heartbeat helps with:
- slow file reads on cloud hostings where cache is not on the same storage as application (Azure);
- slow file includes from composer;
Heartbeat finds all the files in your application, includes and "cache" warms
Best performance calling Heartbeat every 5 minutes having application + vendors under 20 000 files
composer require gundars/heartbeat ~0.1
> php vendor/gundars/heartbeat/load.php
Scanning /var/www/public/zend/approot
10102 files loaded in: 0h 2m 49s
Paste this code in your index.php:
use Heartbeat\Heartbeat;
if (array_key_exists('heartbeat', $_REQUEST)) {
$heartBeat = new Heartbeat();
$heartBeat->load(__DIR__);
}
and call via http(s) http://example.com/?heartbeat=true
<?php
use Heartbeat\Heartbeat;
$heartBeat = new Heartbeat();
$heartBeat->->load(__DIR__ . '/../../../');
Prints all included files
$heartBeat->verbose()->load(__DIR__);
stops script execution after file include is finished
$heartBeat->verbose()->load(__DIR__, true);