Bug #23063
closed
"Latest News" posts not displaying on home pages
Added by Laurie Hurson 6 days ago.
Updated 5 days ago.
Description
Hi All,
I noticed on the home page today (logged in and out) that the "latest News" area is not displaying any content. I think it should be showing the 3 most recent news posts? See screenshots.
Thanks,
Laurie
Files
This section of the site is populated by API requests to news.commons and in.commons. These requests are returning a 403 Forbidden status, which I believe is the result of a Cloudflare security configuration issue. I've reached out to Reclaim for help on this.
I came across a similar conclusion when I was looking at this locally, but saw you were already debugging live and didn't want to step on your toes :)
Would it make sense to use switch_to_blog()
to grab the news posts and then using the object cache instead of JSON + transients? We can, then, invalidate the object cache whenever there is a new post published on news.commons.gc.cuny.edu
/ in.commons.gc.cuny.edu
sites. Posts are infrequently published so we wouldn't need to rely on polling the news sites each day (or less due to how transients work). Or we could stick with JSON when the Cloudflare issue is addressed and switch out the transient usage for object cache instead.
Could also query the BP activity items for those blogs as well. That might be a better solution.
Would it make sense to use switch_to_blog() to grab the news posts and then using the object cache instead of JSON + transients?
There was a reason I decided not to go this path when I originally built it, but I don't remember what it was :) Probably that this technique is more agnostic (could be run with non-Commons sites) and also that it "seems" right - the shortcode is, after all, like an API client. Since the technique has worked fine up until now, I guess my preference is to wait to see if Reclaim can figure out what's gone wrong.
- Status changed from New to Resolved
- Target version set to Not tracked
Reclaim has identified the source of the 403 in Cloudflare and has added our production IP addresses to the whitelist. The Latest News section is now properly populated.
Also available in: Atom
PDF