add and use cache counter