Cache code improvements

mget() foreach statement improved