moving cache size into cache variable, calculated only when data is changed