In my website, I want to present to the user the most viewed product categories in a sidebar, in multiple pages. so in each different view I have: and in the various templates and in that one: However, I would like to calculate the most_viewed_categories value only once every 2 days or so, instead of calculating it in every view.