The 404 page is issuing a minimum of ~15 queries. Some of this is T10077, but some of it isn't.
We can put this stuff in a global cache pool:
- database config (saves 1 query)
- spaces (saves 1 query)
- editengine config (saves 6+ queries today, but only 1 real query, see T10077)
We can put this stuff in a user cache pool:
- preferences (saves 1 query)
- unread messages (saves 2 queries, should be 1 query)
- unread notifications (saves 2 queries, should be 1 query)
- user profile image (saves 1 query)
That should leave only the new cachekey version query and the session query. We can almost certainly move the session query to cache too, but it's more involved to do so.