Re-create UUID cache

I have noticed that updating writer file links programatically only works once a cache file is created, which seems to happen when I highlight the link in the field and wait until it “connects” the file in the editor. Is it possible to create these cache files for all the file links?

It appears this issue has been noted on Github, File Permalinks throw 404 if UUID cache is empty · Issue #5181 · getkirby/kirby · GitHub

Does anyone know if there is a way to repopulate the cache?

Yes. You can put the following code into e.g. a template, open the page in the browser, then remove again. Or put this into some script that you call whenever needed:

<?php
use Kirby\Uuid\Uuids;
Uuids::populate();

Brilliant, thanks @texnixe. I will give it a try!