Maybe we're talking about different things. You only have to worry about what happens on a single load of a page, so a user's field16 isn't going to change. On another page it might be different, but the cache goes away once the page is built, so it doesn't matter.
The idea of caching like I posted above would be that if you ended up needing the value of field16 more than once for the same user on the same page, then you'd save doing a query for it more than once. You said it was being called every time - if you meant every time the page loads, then this kind of cache won't help. You probably don't want a database cache just for all users' field16s. The best thing would be if there was already a query for userdata that you could modify to load the custom profile field values in the same query. But you couldn't do that from the fetch_musername hook - we'd have to know more about what you're doing.
I hope I haven't made things too complicated - maybe you shouldn't worry about it unless it becomes a problem.
|