Comments not showing up on the main sites? Check here first!

Noticing a delay with comments showing up beneath SCW or E/W posts?

The short answer

It’s okay! Nothing is broken. Due to caching, it might sometimes take up to ten minutes for a Discourse comment you make here to show up beneath a SCW or E/W post. Try refreshing the SCW or E/W page after a few minutes. If you’re still not seeing updated comments, try clearing your browser cache and then refreshing again.

The longer answer

Space City Weather and The Eyewall rely on aggressive caching as a major part of our strategy to remain fast and responsive during traffic spikes (like major weather events!). To make that possible, we use a combination of:

  • Cloudflare, with APO enabled
  • Host-level caching, primarily Nginx’s fastcgi cache
  • Application-layer caches (Wordpress object caching via redis & Discourse’s inbuilt caching)

This works really well for us. The posts Eric & Matt make to SCW & E/W don’t change very much after publication, so they’re ideal for caching. We can store snapshots of those pages in cache and serve those snapshots very quickly to visitors.

Comments, on the other hand, are what you’d call dynamic content. The daily forecast’s comment thread changes a lot, every time a comment is added, updated, or removed. Dynamic content doesn’t play well with caching, since it’s changing all the time and everyone wants to see the latest version immediately.

To balance what are essentially competing requirements—the mix of static and dynamic content we serve up—Wordpress does a lot of coordination behind the scenes. When new comments are posted to a story, the entire set of cached copies of that story (which have a snapshot of the current comment section attached to them) are flushed out from all the different places they’re stored, and an updated version (with an updated comment thread) is created and cached.

Discourse hooks into this process and replaces the native Wordpress comments with its own, but that complex orchestration to clear out multiple layers of caches still has to happen. Discourse and Wordpress working together can, sometimes, take up to ten minutes to settle down all the various caches and sync up comments between the Discourse side and the Wordpress side.

(On top of this, web browsers occasionally hang onto cached items longer than they should. Clearing your local browser cache is always a good idea when caching issues are suspected, as it eliminates a potential source of the trouble.)

Bottom line

Don’t worry—comments won’t always show up on the homepage immediately because of caching, and this is expected behavior. You can always visit the discussion thread here on Discourse and see the latest comments showing up in real time.

1 Like