{"id":18778,"date":"2020-02-26T12:18:44","date_gmt":"2020-02-26T17:18:44","guid":{"rendered":"https:\/\/www.boldgrid.com\/support\/?p=18778"},"modified":"2024-02-22T09:57:45","modified_gmt":"2024-02-22T14:57:45","slug":"what-is-fragment-caching-and-why-do-i-need-it","status":"publish","type":"post","link":"https:\/\/www.boldgrid.com\/support\/w3-total-cache\/what-is-fragment-caching-and-why-do-i-need-it\/","title":{"rendered":"What is Fragment Caching and Why Do I Need it?"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"utf-8\" ?><html><body><p>Social layer, personalization, and e-commerce are common elements of highly dynamic websites. That means that there are other solutions than caching entire pages to improve user experience and performance. Fragment Caching bridges the gap between no caching and the &ldquo;ideal,&rdquo; full-page caching. By extending the WordPress Transient API, W3TC allows developers to bring both horizontal and vertical scales to bear without doing anything differently.<\/p>\n<div class=\"boldgrid-section\" style=\"margin-top: 60px;\">\n<div class=\"container w3tc-radius\" style=\"border-width: 0px; background-image: url('https:\/\/www.boldgrid.com\/wp-content\/uploads\/2023\/07\/upsell-darker-alt.png'); background-size: cover; background-position: 50% 5%;\" data-image-url=\"https:\/\/www.boldgrid.com\/wp-content\/uploads\/2023\/07\/upsell-darker-alt.png\">\n<div class=\"row upsell-column\" style=\"padding-top: 2em; padding-bottom: 2em; color: #ffffff;\">\n<div class=\"col-lg-1 col-md-1 col-sm-12 col-xs-12 hidden-sm\"><\/div>\n<div class=\"col-lg-5 col-md-6 col-xs-12 col-sm-7\">\n<p class=\"\" style=\"color: #ffffff; margin-top: 0;\">Unlock dynamic Fragment Caching with <strong>W3 Total Cache Pro<\/strong>.<\/p>\n<\/div>\n<div class=\"col-lg-6 col-md-5 col-sm-5 col-xs-12 text-center align-column-center\">\n<p class=\"\" style=\"border-width: 0px;\"><a class=\"button-w3tc-white\" style=\"border: 2px solid #30BEC4; font-size: 18px; padding: 15px 30px;\" href=\"https:\/\/www.boldgrid.com\/w3-total-cache\/#pricing\">View Plans<\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2 id=\"implement\">How do I implement fragment caching?<\/h2>\n<p>The W3 Total Cache Fragment caching layer adds new functionality to the WordPress Transients API:<\/p>\n<ol>\n<li>Adds support for grouping transients both per blog and sitewide<\/li>\n<li>Adds support for manual flushing of registered transient groups<\/li>\n<li>Adds support for action-based flushing of registered transient groups<\/li>\n<li>Adds support for caching filters and actions<\/li>\n<\/ol>\n<p>To make the plugin aware that you&rsquo;re grouping transients, you can use the following example as a guide:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/harryjackson1221\/951c3483ac6bd8354c028e81cfc25532.js\"><\/script><\/p>\n<p>It&rsquo;s best to test on a page not visible to the public, or even better&mdash;a development environment. Just add define(&lsquo;W3TC_PRO_DEV_MODE&rsquo;, true); to your wp-config.php file to test with Pro features on your development environment.<\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Social layer, personalization, and e-commerce are common elements of highly dynamic websites. That means that there are other solutions than caching entire pages to improve user experience and performance. Fragment Caching bridges the gap between no caching and the &ldquo;ideal,&rdquo; full-page caching. By extending the WordPress Transient API, W3TC allows developers to bring both horizontal [&hellip;]<\/p>\n","protected":false},"author":529,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"bgseo_title":"","bgseo_description":"","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[749,692],"tags":[],"class_list":["post-18778","post","type-post","status-publish","format-standard","hentry","category-fragment-cache","category-w3-total-cache"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/18778","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/users\/529"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/comments?post=18778"}],"version-history":[{"count":13,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/18778\/revisions"}],"predecessor-version":[{"id":125523,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/18778\/revisions\/125523"}],"wp:attachment":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/media?parent=18778"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/categories?post=18778"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/tags?post=18778"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}