4. The normal hash lookup method $cache{$account} works, but with ever-decreasing performance and an ever-increasing memory profile (it got up to 1.4GB of memory usage).
If you got plenty of diskspace and fast disks
Cache::FileCache might be a solution as well. Should keep your memory-usage lower and doesn't have that much overhead.