Added very simple caching to speed things up

The cache data expires after 3 sec, but the stale data are never
cleared. So, this version will accumulate data and eat up ram with each
new query. We should add a cahce cleaning thread to keep things
scaleable.