{"id":108439,"date":"2023-10-09T12:20:56","date_gmt":"2023-10-09T16:20:56","guid":{"rendered":"https:\/\/www.boldgrid.com\/support\/?p=108439"},"modified":"2025-11-12T12:51:59","modified_gmt":"2025-11-12T17:51:59","slug":"bunny-cdn-setup","status":"publish","type":"post","link":"https:\/\/www.boldgrid.com\/support\/w3-total-cache\/bunny-cdn-setup\/","title":{"rendered":"How to Set Up Object Caching and Full Site Delivery with Bunny CDN"},"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><div class=\"boldgrid-section\">\r\n<div class=\"container\">\r\n<div class=\"row\">\r\n<div class=\"col-lg-12 col-md-12 col-xs-12 col-sm-12\">\r\n<h2 class=\"wp-block-heading\" id=\"object-caching\">Object Caching<\/h2>\r\n<p class=\"\">Setting up Object Caching with W3 Total Cache and Bunny CDN allows you to quickly serve static assets, like media, CSS, and JS files, to your users across the globe.<\/p>\r\n<h3 class=\"wp-block-heading\" id=\"createselect-your-pull-zone\">Create\/Select your Pull Zone<\/h3>\r\n<p class=\"\">The pull zone set up here will be associated with your website domain and used as the source for serving static assets to your website visitors.<\/p>\r\n<ul class=\"\">\r\n<li>Log into your Bunny dashboard and navigate to <strong>Delivery<\/strong> &gt; <strong>CDN<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Click <strong>+ Add Pull Zone<\/strong> to create a new Pull Zone for Object Caching if you do not already have one you want to reuse.<\/li>\r\n\r\n\r\n\r\n<li>You can use any name you wish for the <strong>Pull Zone Name<\/strong> field, but make sure to use your website&rsquo;s domain in the <strong>Origin URL<\/strong> one.<\/li>\r\n\r\n\r\n\r\n<li>Click <strong>Add Pull Zone<\/strong> when finished.<\/li>\r\n<\/ul>\r\n<h3 class=\"wp-block-heading\" id=\"configure-w3-total-cache\">Configure W3 Total Cache<\/h3>\r\n<p class=\"\">These next steps will show you how to use W3 Total Cache as a link between your Bunny CDN Pull Zone and your actual website.<\/p>\r\n<ul class=\"\">\r\n<li>Log into your website and install\/activate the W3 Total Cache plugin.<\/li>\r\n\r\n\r\n\r\n<li>Navigate to <strong>Performance &gt; General Settings<\/strong> and scroll down to the <strong>CDN<\/strong> section.<\/li>\r\n\r\n\r\n\r\n<li>Click on the <strong>CDN<\/strong> checkbox to enable it and select <strong>Generic Mirror<\/strong> from the <strong>CDN Type<\/strong> dropdown.<\/li>\r\n\r\n\r\n\r\n<li>Next, go to <strong>Performance &gt; CDN<\/strong> in your WordPress admin.<\/li>\r\n\r\n\r\n\r\n<li>Locate the <strong>Configuration<\/strong> section.<\/li>\r\n\r\n\r\n\r\n<li>Enter the name of the Pull Zone you created earlier into the <strong>Replace site&rsquo;s hostname with:<\/strong> field.<\/li>\r\n\r\n\r\n\r\n<li><strong>Save Settings<\/strong> and <strong>Purge all Caches<\/strong>.<\/li>\r\n<\/ul>\r\n<h2 class=\"wp-block-heading\" id=\"full-site-delivery\"><a href=\"#FSD_CDN\">Full Site Delivery<\/a><\/h2>\r\n<p class=\"\">Full Site Delivery is a CDN configuration for content delivery that goes beyond caching static files; it also handles complete web pages. With this setup, the CDN functions as a proxy server, fetching entire web pages from the origin server, caching them, and subsequently delivering them to end users in their entirety.<\/p>\r\n<h3 class=\"wp-block-heading\" id=\"createselect-your-zones\">Create\/Select your Zones<\/h3>\r\n<p class=\"\">The first thing that we need to do is set up the Pull and Storage Zones in the Bunny Dashboard. The Pull Zone is where you can manage all of the Caching settings associated with the CDN and the Storage zone is used to house copies of your website files on Bunny&rsquo;s servers to help reduce delivery times.<\/p>\r\n<ul class=\"\">\r\n<li>Log into your Bunny dashboard and navigate to <strong>Delivery<\/strong> &gt; <strong>CDN<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Click <strong>+ Add Pull Zone<\/strong> to create a new Pull Zone for Full Site Delivery if you do not already have one you want to reuse.<\/li>\r\n\r\n\r\n\r\n<li>Go to <strong>Delivery<\/strong> &gt; <strong>Storage<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Click <strong>+ Add Storage Zone<\/strong> to create a new Storage Zone for Full Site Delivery if you do not already have one you want to reuse.<\/li>\r\n<\/ul>\r\n<h3 class=\"wp-block-heading\" id=\"configure-caching-settings\">Configure Caching Settings<\/h3>\r\n<p class=\"\">Bunny offers a variety of configuration options that can be utilized to create a Full Site Delivery environment that will improve response times and performance for your website.<\/p>\r\n<h4 class=\"wp-block-heading\" id=\"disable-smart-cache\">Disable Smart Cache<\/h4>\r\n<p class=\"\">Smart Cache is a system developed by Bunny that dynamically selects if a request should be cached based on the file extension and MIME type to allow easy full-site acceleration. However, this feature does exclude HTML MIME types from getting cached on the network, so it needs to be disabled to provide a true Full Site Delivery experience for end users.<\/p>\r\n<ul class=\"\">\r\n<li>Navigate to <strong>Delivery &gt; CDN<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Select your Pull Zone.<\/li>\r\n\r\n\r\n\r\n<li>Go to <strong>Caching &gt; General<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Disable <strong>Smart Cache<\/strong>.<\/li>\r\n<\/ul>\r\n<h4 class=\"wp-block-heading\" id=\"disable-strip-response-cookies\">Disable Strip Response Cookies<\/h4>\r\n<p class=\"\">If enabled, bunny.net will strip all the Set-Cookie headers from the zone hostname. Cookies are required for WordPress.<\/p>\r\n<ul class=\"\">\r\n<li>Go to Caching &gt; General in your Pull Zone settings.<\/li>\r\n\r\n\r\n\r\n<li>Disable <strong>Strip Response Cookies<\/strong>.<\/li>\r\n<\/ul>\r\n<h4 class=\"wp-block-heading\" id=\"set-expiration-rules\">Set Expiration Rules<\/h4>\r\n<p class=\"\">The Cache Expiration Time and Browser Cache Expiration Time settings can be configured to allow you to manage\/purge cached items from your website using the tools provided by W3 Total Cache in the WordPress admin.<\/p>\r\n<ul class=\"\">\r\n<li>Go to Caching &gt; General in your Pull Zone settings.<\/li>\r\n\r\n\r\n\r\n<li>Change <strong>Cache Expiration Time<\/strong> to <strong>Respect Origin Cache-Control<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Set <strong>Browser Cache Expiration Time<\/strong> to <strong>Match Server Cache Expiration<\/strong>.<\/li>\r\n<\/ul>\r\n<h4 class=\"wp-block-heading\" id=\"activate-perma-cache\">Activate Perma-Cache<\/h4>\r\n<p>Perma-Cache is a persistent object storage system that keeps copies of your website files on Bunny&rsquo;s content delivery network which reduces the delivery time of website assets to end users.<\/p>\r\n<ul class=\"\">\r\n<li>Open your Pull Zone settings.<\/li>\r\n\r\n\r\n\r\n<li>Go to <strong>Caching<\/strong> &gt; <strong>Perma-Cache<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Select the Storage Zone you created earlier with the dropdown and <strong>Save Configuration<\/strong>.<\/li>\r\n<\/ul>\r\n<h3 class=\"wp-block-heading\" id=\"make-the-edge-rules\">Make the Edge Rules<\/h3>\r\n<p class=\"\">Serving static HTML pages from a CDN is a great way to deliver content to your users quickly, but there can be some issues that arise once dynamic WordPress login sessions enter the mix. Fortunately Bunny provides the ability to create custom Edge Rules that allow you to keep serving static HTML pages and keep your login sessions working correctly.<\/p>\r\n<ul>\r\n<li>Open your <strong>Pull Zone<\/strong> settings and navigate to <strong>Edge Rules<\/strong>.<\/li>\r\n<\/ul>\r\n<h4 class=\"wp-block-heading\" id=\"override-cache-time\">Override Cache Time<\/h4>\r\n<ul class=\"\">\r\n<li>Click <strong>+Add Edge Rule<\/strong>\r\n<ul class=\"wp-block-list\">\r\n<li>Select <strong>Override Cache time<\/strong> from the <strong>Action<\/strong> dropdown.<\/li>\r\n\r\n\r\n\r\n<li>Enter 0 into the <strong>Cache time in seconds<\/strong> field.<\/li>\r\n\r\n\r\n\r\n<li>Add a <strong>Request URL<\/strong> &gt; <strong>Match Any<\/strong> condition with the following triggers:\r\n<ul class=\"wp-block-list\">\r\n<li><strong>*\/wp-admin*<\/strong><\/li>\r\n\r\n\r\n\r\n<li><strong>*\/wp-login*<\/strong><\/li>\r\n<\/ul>\r\n<\/li>\r\n\r\n\r\n\r\n<li><strong>+ Add another condition<\/strong> to the rule and select <strong>Request Header<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Enter <strong>Cookie<\/strong> into the <strong>Header Name<\/strong> field.<\/li>\r\n\r\n\r\n\r\n<li><strong>Match any<\/strong> of the following properties for the condition:\r\n<ul class=\"wp-block-list\">\r\n<li><strong>*wordpress_logged_in_*<\/strong><\/li>\r\n\r\n\r\n\r\n<li><strong>*wordpress_sec_*<\/strong><\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<h4 class=\"wp-block-heading\" id=\"override-browser-cache-time\">Override Browser Cache Time<\/h4>\r\n<ul>\r\n<li>Click <strong>+Add Edge Rule<\/strong>\r\n<ul class=\"wp-block-list\">\r\n<li>Select <strong>Override Browser Cache time<\/strong> from the <strong>Action<\/strong> dropdown.<\/li>\r\n\r\n\r\n\r\n<li>Enter 0 into the <strong>Cache time in seconds<\/strong> field.<\/li>\r\n\r\n\r\n\r\n<li>Add a <strong>Request URL<\/strong> &gt; <strong>Match Any<\/strong> condition with the following triggers:\r\n<ul class=\"wp-block-list\">\r\n<li><strong>*\/wp-admin*<\/strong><\/li>\r\n\r\n\r\n\r\n<li><strong>*\/wp-login*<\/strong><\/li>\r\n<\/ul>\r\n<\/li>\r\n\r\n\r\n\r\n<li><strong>+ Add another condition<\/strong> to the rule and select <strong>Request Header<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Enter <strong>Cookie<\/strong> into the <strong>Header Name<\/strong> field.<\/li>\r\n\r\n\r\n\r\n<li><strong>Match any<\/strong> of the following properties for the condition:\r\n<ul class=\"wp-block-list\">\r\n<li><strong>*wordpress_logged_in_*<\/strong><\/li>\r\n\r\n\r\n\r\n<li><strong>*wordpress_sec_*<\/strong><\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<h4 class=\"wp-block-heading\" id=\"bypass-perma-cache\">Bypass Perma-Cache<\/h4>\r\n<ul class=\"\">\r\n<li>Click <strong>+Add Edge Rule<\/strong>\r\n<ul class=\"wp-block-list\">\r\n<li>Select <strong>Bypass Perma-Cache<\/strong> from the <strong>Action<\/strong> dropdown.<\/li>\r\n\r\n\r\n\r\n<li>Add a <strong>Request URL<\/strong> &gt; <strong>Match Any<\/strong> condition with the following triggers:\r\n<ul class=\"wp-block-list\">\r\n<li><strong>*\/wp-admin*<\/strong><\/li>\r\n\r\n\r\n\r\n<li><strong>*\/wp-login*<\/strong><\/li>\r\n<\/ul>\r\n<\/li>\r\n\r\n\r\n\r\n<li><strong>+ Add another condition<\/strong> to the rule and select <strong>Request Header<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Enter <strong>Cookie<\/strong> into the <strong>Header Name<\/strong> field.<\/li>\r\n\r\n\r\n\r\n<li><strong>Match any<\/strong> of the following properties for the condition:\r\n<ul class=\"wp-block-list\">\r\n<li><strong>*wordpress_logged_in_*<\/strong><\/li>\r\n\r\n\r\n\r\n<li><strong>*wordpress_sec_*<\/strong><\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<\/li>\r\n<\/ul>\r\n<h3 class=\"wp-block-heading\" id=\"update-nameserver-records\">Update Nameserver Records<\/h3>\r\n<p>The last step for completing the Full Site Delivery setup is to update the Nameserver records associated with your domain name at the registrar and enable CDN Proxy for your domain in the Bunny&rsquo;s DNS.<\/p>\r\n<ul>\r\n<li>Go to <strong>DNS<\/strong> &gt; <strong>DNS Records<\/strong> and enable <strong>CDN Proxy<\/strong> for the domain.<\/li>\r\n\r\n\r\n\r\n<li>Locate the Nameserver records under <strong>DNS<\/strong> &gt; <strong>Nameservers<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Update the Registrar NS records using those nameservers.<\/li>\r\n<\/ul>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":880,"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":[746,692],"tags":[],"class_list":["post-108439","post","type-post","status-publish","format-standard","hentry","category-cdn","category-w3-total-cache"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/108439","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\/880"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/comments?post=108439"}],"version-history":[{"count":13,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/108439\/revisions"}],"predecessor-version":[{"id":165835,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/108439\/revisions\/165835"}],"wp:attachment":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/media?parent=108439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/categories?post=108439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/tags?post=108439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}