Speed up flushing of file cache


#21

Think this is done in Kirby 3


#22

No, not in Kirby 2…


#23

Unfortunately not (and some more chars)


#24

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


#25

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

https://getkirby.com/docs/developer-guide/advanced/caching/#cache-drivers


#26

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


#27

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.


#28

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


#29

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:


#30

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.