So we've been using this method of caching for several years with great success, but now are running into an issue. What's happening is that if a banned IP visits the site while logged out, and receives the banned IP message, then that message is cached for future visitors. It caused quite a bit of confusion before I was able to figure out that's what was going on.
What would be the recommended fix for this? Set a "banned_ip" cookie if the IP is banned, and then configure nginx to check for that? Maybe just send a nocache header from PHP so that nginx can catch that? Something else?
Yes, and that's the backup plan. But the forum moderators/administrators don't have access to modify the nginx configuration, so doing that removes their ability to ban IPs, and I'll need to figure out if it's a suitable solution.