It has been awhile since I have written, but I wanted to detail how and when to use WordPress transients. First off, what are transients? WordPress has a great API for storing data that might be either the results of an expensive/complex query, or data that does not change that often. The rationale behind these is to make the pages load faster without having to do the expensive queries for every user that visits your site. They offer us an expiration date so that the data can be regenerated on a schedule.
I have two examples in the full article for you to review. Hopefully they will help you make your site more efficient.
Here is a compact way to replicate jQuery UI tabs without the UI. I wrote this code to account for unlimited tabs and to create dynamic "selected" class on the clicked item and removes the class when you click on another tab. This lends itself to easier styling of the tabs as well.
I was recently working on a BuddyPress site where the site owner wanted everyone who signed up to be a friend of a "support" user. He wanted people to be able to direct message this account, and in this case, he had Comet Chat installed. This meant that if "support" were online, then anyone could chat with support. I dug into the BuddyPress DB to see how friends were enabled and wrote this function that you can put into your themes functions.php to enable.