Sometimes the same entity and node pair is queried multiple times in a brief period. Assuming that entities typically do not change their disco#info and disco#items related capabilities, we could avoid a network I/O if Smack would cache the results for a short period (30 seconds, 1 minute, 5 minutes),
Note that until DiscoverInfo and DiscoverItems is mutable, the need to return cloned instances of the classes.
Methods where the caches should be plugged in
- ServiceDiscoveryManager.discoverInfo(Jid, String)
- ServiceDiscoveryManager.discoverItems(Jid, String