Im building a music social web. For a particular view (where the user sees a world map, which shows de procedence of the plays his songs had) i have a long and heavy php code, which retrieves a lot of info from the database and counts rows,etc.
How am i supposed to cache the result of this php code and only allow to execute it once an hour? The idea is to "update" this section once an hour, and during that period, the user must only see the cached version of the map.