How about making the user directory serializer accept a new parameter like users.json?include_profile=true
Then we can add a JS plugin API which allows themes to add this parameter:
api.userListIncludeProfile(true)
“Profile” would include all the things in the regular user serializer (being careful not to introduce n+1 queries). I don’t think specifying individual fields is going to make much difference to performance, so IMO we should keep it simple.
The same approach could work for topic lists as well ?include_excerpts=true
I also like this because it means the “per-theme serializer configuration” won’t get broken by the anon cache!
What do you think @sam?