Speed up flushing of file cache


Think this is done in Kirby 3


No, not in Kirby 2…


Unfortunately not (and some more chars)


Thanks for your feedback @texnixe & @jimbobrjames. I hope @bnomei can help me out somehow.


You could test with your own cache driver if removing and recreating the cache folder is faster than the current method.



Do you have a hint what the “nuke folder” command is on linux? AFAIK rm -rf recursively deletes the contents first too before removing the directory. I’m afraid it’s not faster then find -delete


I just tested what happens when the cache directory is not present, as in theory this can happen when I’m recreating it. Then I get a HTTP ERROR 500 from the server, which is not a good solution imho.


Give rSync a shot… see here. This should also get around the 500 error with missing folder


I decided to fix it quick and dirty by running a nightly cronjob which flushes cache (via rsync - it looks like its a tiny bit faster) as @texnixe suggested. :crossed_fingers:


bit late to the party.

for k2 and the big sites i created i never used kirbys build in cache but split the site into cachable parts and just aggregated the results. i used the kirby cache folder and a 2-monthly cronjob.

i mainly used my own implementation or https://github.com/kirby-deprecated-plugins/kirby-time-cache.
for k3 i am using my https://github.com/bnomei/kirby3-lapse.
the tricky part is to make the parts small enough to track modification correctly but also efficiently (check & loading must be faster than creating). what i also did was making the cache alway-write-only when in debug mode – making it easy to force updates.

my usecase was creating a headings list for 3000 pages with thumbs and similar stuff. but i must say that in most other cased the built in cache and a regular crobjob should be fine.