{"id":82662,"date":"2012-06-25T11:00:53","date_gmt":"2012-06-25T15:00:53","guid":{"rendered":"http:\/\/wpmu.org\/?p=82662"},"modified":"2013-04-17T20:35:52","modified_gmt":"2013-04-18T00:35:52","slug":"wordpress-transients","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/wordpress-transients\/","title":{"rendered":"Transient Love: How to give WordPress Transients a try"},"content":{"rendered":"<h2>Page caching is really good&#8230;<\/h2>\n<p>Most busy WordPress websites make use of some <a title=\"Understand Caching in WordPress, Part 1: The Basics\" href=\"https:\/\/wpmudev.com\/blog\/understand-caching-in-wordpress-part-1-the-basics\/\" target=\"_blank\">page caching plugin<\/a> to ease processing load off servers and please site visitors with faster page loads. These <a href=\"https:\/\/wpmudev.com\/blog\/which-wordpress-cache-plugin\/\" target=\"_blank\">WordPress caching plugins<\/a> cache entire pages for serving up quickly.<\/p>\n<h2>&#8230;except when it isn&#8217;t<\/h2>\n<p>Sometimes, however, cached pages cannot be used. This is common for:<\/p>\n<ul>\n<li><a title=\"How to Create a Free or Paid Membership Site with WordPress and the Membership Plugin\" href=\"https:\/\/wpmudev.com\/blog\/how-to-create-a-free-or-paid-membership-site-with-wordpress-and-the-membership-plugin\/\" target=\"_blank\">Membership sites<\/a>, where user-specific content would make cached pages incorrect for most users.<\/li>\n<li>Sites with rapidly updated page content, where cached pages would not keep up with visitors&#8217; expectations.<\/li>\n<li>Sites presenting unique content based on visitors&#8217; location, browser, and other personal variables.<\/li>\n<\/ul>\n\n<h2>Partial page caching to the rescue<\/h2>\n<figure id=\"attachment_82752\" class=\"wp-caption alignleft\" data-caption=\"true\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-82752\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2012\/06\/html-fading.jpg\" alt=\"WordPress Transients - Suggests how code stored as transients have a limited lifespan\" width=\"300\" height=\"240\" \/><figcaption class=\"wp-caption-text\">Data stored in WordPress transients are automatically removed after a specified time.<\/figcaption><\/figure>\n<p>Even when the entire page should not be cached, there are usually certain parts of the page that rarely change and are still ripe for the benefits of caching. In this lesson, I will show you how to cache the global menu of your website &#8212; an element that rarely changes and is often found on every page of the site.<\/p>\n<h2 style=\"clear: left;\">Learn to love transients<\/h2>\n<p>Rather than reinventing the wheel, we will use built-in WordPress functions for data blocks we call &#8220;<a title=\"Transients API in the WordPress Codex\" href=\"http:\/\/codex.wordpress.org\/Transients_API\" rel=\"noopener\" target=\"_blank\">transients<\/a>.&#8221; Let&#8217;s get to work in the video below!<\/p>\n<p><span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><span class=\"embed-youtube-lazy-id dev-hidden\">EGWcRff1s4s<\/span><\/span><\/p>\n<p>And there you have it &#8212; partial page caching.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>WordPress transients may not be seen often, but here we learn how to use transients to pick up the slack where page caching plugins will not work.<\/p>\n","protected":false},"author":97717,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[1086,1067,87,548,261],"tutorials_categories":[],"class_list":["post-82662","post","type-post","status-publish","format-standard","hentry","category-tutorials","tag-caching","tag-membership","tag-menus","tag-performance","tag-video"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/82662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/97717"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=82662"}],"version-history":[{"count":1,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/82662\/revisions"}],"predecessor-version":[{"id":204472,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/82662\/revisions\/204472"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=82662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=82662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=82662"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=82662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}