Cache UPNs by SID for 30 seconds

This should solve the complaint of speed problems in #162.