If you reveal IP addresses for temp accounts on e.g. a history page or RecentChanges/Watchlist, we remember which accounts you've already clicked "Show IP" for, and the next time you visit the history/RecentChanges/Watchlist page, we automatically re-reveal the IP address after making a POST request to fetch the data.
We use browser localStorage to keep track of which temp account IDs someone has clicked "Show IP" for. (We can't cache the IP itself in localStorage to avoid storing sensitive data in the user's browser.)
If you've clicked "reveal" for a bunch of accounts on a page, we make one request per account when loading the page. This can be inefficient if there are dozens or hundreds of accounts on a given page.
To improve on this, we could obtain a list of all the accounts that we should fetch IP information for, and batch them in a single request, generating any access logs as necessary.