Oc_filecache is weird. Where can I find a listing of all Files <> fileIds?

I’m using Nextcloud to maintain a documentation library for end users. Users are placed in groups which have access to locations listed under “External Storages” and they are adding tags/comments to the files they upload. I built an external html index of all these files and comments/tags however going through WebDAV+curl is becoming incredibly slow as more files are being added to the system (500+ already) so an alternative was needed.

I put together an external list utility in ruby which uses Active Record to relate all the entries in oc_filecache, oc_storages, oc_comments and oc_systemtag but it seems that recently added files and directories are not showing up in oc_filecache. Why is this? Is there somewhere else I should be looking? I think If I can at least get the filename and fileID I should be able to get the rest of the info. Something is just weird with the way oc_filecache is working on my system; eg:if I add an “External Storage” object on my system, it doesn’t seem to immediately show up in oc_filecache. Not sure how it gets there.

With external storages ?
Because filecache isn’t always updated when using external storages, so when you add files to a ftp server using something else than nextcloud, it won’t be in filecache until a complete update of the cache, this is how I understand things

I remember there is a commandline to trigger a complete rescan of the external storage, but the best would be to always use nextcloud, and to add files through webdav instead of ftp/smb/sftp/ftps/etc

Thanks! I think I found the command you speak of:
cd /var/www/nextcloud && sudo -u www-data php occ files:scan --all

Thing is, my nextcloud instance is serving files from a mounted back-end storage which is shared between nextcloud and an sftp process on another server. I’ll just have to run the command above on a regular basis to keep oc_filecache updated.

Incidentally and somewhat related to another post I made earlier – One of our on-site Ruby devs created an external script which creates a JSON feed containing system paths and attached tags for all the files on our external storage locations in Nextcloud. The script uses Active Record to trawl the Nextcloud database so it’s much faster than getting this info from WebDAV which is painfully slow for more than a handful of files. If anyone is interested in it, let me know. I’ll see if we can post it to github.