Drupal has an inbuilt caching system, but it needs to be used effectively to get any benefit from it. For data accessed many times during the same request, data should be statically cached. If it's consistent over a longer period of time, it should also be added to the core cache.
The following is my template code that I used any time I need to pull something from the cache. I modify it based on what I expect to happen to the data.