cache and count

Hopefully even less database load
Release 3.1.1