When I flush the pages cache via cli it doesn’t clear the cache.
Test Setup
- Fresh startkit
- Turn on Cache in config.php
- Open the website via browser to fill the cache
- Confirm that the cache folder was created and a cache file exists. In my case
site/cache/localhost_startkit/pages/home.html.cache
- Create flush.php in your root:
<?php
require 'kirby/bootstrap.php';
$kirby = new Kirby();
$kirby->cache('pages')->flush();
- Run
php flush.php
on the command line - Check the cache folder
ls site/cache
→_ localhost_starterkit
. A new folder named_
got created and the cached page is still there:site/cache/localhost_startkit/pages/home.html.cache
.
Debugging
dump($this->root());
in the flush method kirby/src/Cache/FileCache.php:160
yields [...]/cache/_/pages
.
So the root, or more specific the prefix is incorrect. How would Kirby know the domain name though? I can’t think of a way for Kirby to detect it since everything is running via cli.
On the other hand, @bnomei somehow gets flush
to work from the cli with janitor.