Hi friends – I’m trying to understand what’s happening with a self-hosted (Heroku) based blog I’m working on.
We recently moved our blog to be served through AWS Cloudfront, and it’s caching effectively, but maybe too effectively. To avoid issues with caching specifically when editing/publishing, we use the non-cached URL (see link below).
The issue: when clicking “publish”, the pages don’t immediately appear. They show up on category pages and the image/title/excerpts load as usual, but the URL points to /404. Only later does the URL change to the correct slug, usually between 30 minutes to an hour. This can be frustrating if trying to publish a new post on the homepage, yet when it appears as a thumbnail on the homepage, the link directs to 404 for a while and eventually updates.
I found this post which recommends excluding the /ghost* path from caching, but that’s not relevant for us because we’re using the non-CDN URL to edit/publish posts.
Cloudfront is set up to refresh every 24 hours. We could, of course, lower that duration, but that would negate the benefits of using a CDN to begin with.
Any suggestions? Why would just the URL not update when everything else seems to respond immediately (tag pages show the post, the thumbnail/title/excerpt loads correct)?
What version of Ghost are you using?
Node 8.9.x, Heroku, AWS Cloudfront
Latest Chrome version