Hi @damiano891db2b
Are you using magento default cache file system? You can check once after change to db or files once to make sure.
There might be some permission issue.
https://devdocs.magento.com/guides/v2.3/config-guide/prod/prod_file-sys-perms.html
Try the following command once:
find . -type d -exec chmod 755 {} \; && find . -type f -exec chmod 644 {} \; && chmod u+x bin/magento
You can use sudo as well.
If still face issue, then try following commands once in sequence to re generations.
chmod -R 0777 var/ pub/ generated/
rm -rf var/cache/* var/view_preprocessed/* generated/* pub/static/*
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
Ror re-indexing once.
php bin/magento indexer:reindex
I hope it will help you!