Ah! I was already using that, but your comment made me re-examine this mechanism and it now works correctly. You can test on blenderartists.org if you like. I’m using an asynchronous job to load the json and render the HTML. This is cached in the browser and then inserted into the menu whenever needed. I refresh the cached data every 5 minutes to update the ‘notification count’ on the news menu as needed.
The code is still not my finest, but once I’ve cleaned it up I’m happy to share it if anyone is interested.