This is even reflected in the corresponding text file alongside the image on the filesystem:
However, upon reloading the page, the caption is blank (even though the caption is still set in the file), and attempting to access it via the template via (string)$image->caption() returns an empty string.
It works perfectly in page fields. The site is multilingual, however. I’m not sure if this is relevant.
It’s such a strange behaviour, when saving, it just reverts to some incorrect previous string and on refresh, shows the wrong information even though the change is saved to the file:
I don’t see any errors/warnings in the js console either fwiw
I could send it, you may be correct though as it doesn’t happen locally, only on the remote server.
However, I don’t have caching enabled on the server.
EDIT Okay @texnixe you are right as always! The culprit was the site is behind cloudflare and cloudflare’s caching was causing this problem! How confusing.
Thanks again for finding the right path to the solution! In case it helps anyone, I just set a ‘Page Rule’ in cloudflare to avoid caching on the panel route.
Everything is working as well as the API/template response now.