Hi Grav community,
I’m running a Grav CMS site locally for a nonprofit project on Ubuntu 22.04, with the Admin Dashboard accessible at http://192.168.193.106/admin
. I’ve run into a consistent issue with the Admin Preview not reflecting edits:
Behavior:
- I edit a page using the Admin editor and click Save.
- The edit is correctly stored and visible when I later visit the page manually in a browser.
- I then click the Clear Cache button (using the Admin Power Tools plugin).
- When I click Preview from the Admin panel, it still shows the old version of the page.
- Even opening the preview in a new tab or refreshing it doesn’t help.
- However, running
sudo bin/grav clear-cache
from the terminal does force the Preview to update.
So far I’ve tried:
- Confirming that Twig cache is enabled (
twig.cache: true
) - Installing and using Admin Power Tools
- Confirming edits are saved correctly and show on the frontend after CLI-based cache clears
- Tested with FireFox browser.
This only affects the Preview inside the Admin panel — not the site itself.
Also worth noting:
When browsing to http://ponyxps.com, all edited pages load correctly after a refresh or after clearing cache.
However, each page takes 3–5 seconds to render, possibly due to caching being disabled (twig.cache: false) or slow template recompilation.
Preview within the Admin still shows old content until cache is cleared via CLI.
Question:
- Is this a known issue or expected behavior of Grav Admin’s Preview iframe?
- Is there a reliable way to clear the preview cache specifically when saving a page?
- I do not like it, but : Would a custom plugin hooking into
onAdminSave
and callingclearCache()
be the best solution? (I would much rather have it just work.)
Thanks in advance!
Richard