No matter how your website may be fast, it’s always good idea to find some new ways to speed it up. This time, speed will be gain by using very simple cache method that will allow you to cache some parts of the page: menus, widgets and other elements that don’t change that often.
Many parts of the page don’t change often, but require many SQL queries to be executed. If you have complex menu that combines categories, pages or posts and it can take more than 20 or even 50 SQL queries to make. For instance, all 3 menus on Dev4Press take about 30 SQL queries to get URL’s or structure. Similar situation is with widgets that don’t change every day, but can take a lot of SQL queries.
Cache method that I want to describe uses database to manually store rendered HTML into the wp_options table using transient records that can have expiry time, allowing you to set how long the cached data will be valid. In multisite mode, for rendering that is related to all websites you can use wp_sitemeta table with transient records. I will note the different functions for this later.