{"id":7699,"date":"2026-04-15T09:54:24","date_gmt":"2026-04-15T07:54:24","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=7699"},"modified":"2026-04-15T09:54:26","modified_gmt":"2026-04-15T07:54:26","slug":"cdn-and-dynamic-content-esi-byo-keys-personalization","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/cdn-and-dynamic-content-esi-byo-keys-personalization\/","title":{"rendered":"CDN and dynamic content \u2013 \u200b\u200bESI, BYO keys, personalization"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\" id=\"p-rc_e942c927e4143670-249\">Dynamic content and CDNs are no longer mutually exclusive in 2026. The modern &#8220;Programmable Edge&#8221; allows you to treat your CDN not just as a static file store, but as a distributed assembly engine.<sup><\/sup> For your <strong>mybox<\/strong> server, this means you can serve personalized, real-time pages with the speed of a static site.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/cdn-and-dynamic-content-esi-byo-keys-personalization\/#1_Fragment_Caching_The_ESI_Edge_Worker_Patterns\" >1. Fragment Caching: The ESI &amp; Edge Worker Patterns<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/cdn-and-dynamic-content-esi-byo-keys-personalization\/#2_BYO_Cache_Keys_Eliminating_Cache_Fragmentation\" >2. BYO Cache Keys: Eliminating Cache Fragmentation<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/cdn-and-dynamic-content-esi-byo-keys-personalization\/#3_Personalization_Without_Destroying_the_Cache\" >3. Personalization Without Destroying the Cache<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/cdn-and-dynamic-content-esi-byo-keys-personalization\/#4_Invalidation_Consistency_and_%E2%80%9CSurrogate_Keys%E2%80%9D\" >4. Invalidation, Consistency, and &#8220;Surrogate Keys&#8221;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/cdn-and-dynamic-content-esi-byo-keys-personalization\/#5_Security_Protecting_the_Private_Edge\" >5. Security: Protecting the Private Edge<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/cdn-and-dynamic-content-esi-byo-keys-personalization\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Fragment_Caching_The_ESI_Edge_Worker_Patterns\"><\/span><strong>1. Fragment Caching: The ESI &amp; Edge Worker Patterns<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In 2026, the most effective way to handle dynamic HTML is to break the page into &#8220;fragments.&#8221;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ESI (Edge Side Includes):<\/strong> This classic method is still highly effective for standard caching. Your <strong>mybox<\/strong> server sends an HTML template with tags like <code>&lt;esi:include src=\"\/api\/user-bar\" \/><\/code>. The CDN (like Akamai or Fastly) fetches only that small fragment and &#8220;punches&#8221; it into the cached page.<\/li>\n\n\n\n<li><strong>Edge Assembly (Workers\/Compute):<\/strong> For platforms like <strong>Cloudflare<\/strong> or <strong>Vercel<\/strong>, you use &#8220;Edge Workers.&#8221; These are tiny scripts running in 300+ cities that intercept the request. They fetch the main page from the cache and then use <strong>Parallel Fetching<\/strong> to inject a &#8220;Hello, User&#8221; name or a shopping cart count directly at the edge.<\/li>\n\n\n\n<li><strong>The 2026 Strategy:<\/strong> Always mark user-specific fragments as <code>Cache-Control: private, no-store<\/code> to ensure they never leak between different visitors.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_BYO_Cache_Keys_Eliminating_Cache_Fragmentation\"><\/span><strong>2. BYO Cache Keys: Eliminating Cache Fragmentation<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<\/div>\n\n<div id=\"mybox-1676964083\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">&#8220;Bring Your Own&#8221; (BYO) cache keys allow you to define exactly what makes a page &#8220;unique&#8221; in the CDN&#8217;s eyes.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Normalizing Keys:<\/strong> By default, every tracking parameter (like <code>?utm_source=fb<\/code>) creates a <em>new<\/em> cache entry, which destroys your hit ratio. In 2026, you should configure <strong>Cache Response Rules<\/strong> on Cloudflare or VCL on Fastly to &#8220;strip&#8221; these parameters before the cache key is generated.<\/li>\n\n\n\n<li><strong>Segmented Keys (Bucketing):<\/strong> Instead of caching per user, cache per <strong>User Segment<\/strong>.\n<ul class=\"wp-block-list\">\n<li><strong>Currency:<\/strong> <code>key = path + currency_USD<\/code><\/li>\n\n\n\n<li><strong>Language:<\/strong> <code>key = path + lang_RO<\/code><\/li>\n\n\n\n<li><strong>Device:<\/strong> <code>key = path + device_mobile<\/code><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Result:<\/strong> You serve 3\u20134 variations of a page instead of 1,000, ensuring a high <strong>Cache Hit Ratio<\/strong> while maintaining local relevance.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_Personalization_Without_Destroying_the_Cache\"><\/span><strong>3. Personalization Without Destroying the Cache<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In 2026, the best personalization strategies follow the <strong>&#8220;Shell and Core&#8221;<\/strong> model:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>The Shell (Cached):<\/strong> The page layout, navigation, and main article are cached on the CDN for 24 hours.<\/li>\n\n\n\n<li><strong>The Core (Dynamic):<\/strong> User-specific data is loaded via <strong>Client-Side AJAX<\/strong> after the page loads.\n<ul class=\"wp-block-list\">\n<li><em>Example:<\/em> The product page loads in 50ms (from CDN), and then a tiny script fetches the &#8220;Your Price&#8221; or &#8220;Items in Cart&#8221; data in another 100ms.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Edge Personalization:<\/strong> For VIP users or A\/B tests, use <strong>Cloudflare KV<\/strong> (Key-Value storage) at the edge. You can store &#8220;User X = Segment B&#8221; at the edge, allowing the CDN to serve a personalized version of the page without ever hitting your <strong>mybox<\/strong> origin.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_Invalidation_Consistency_and_%E2%80%9CSurrogate_Keys%E2%80%9D\"><\/span><strong>4. Invalidation, Consistency, and &#8220;Surrogate Keys&#8221;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"p-rc_e942c927e4143670-252\">The biggest fear with dynamic caching is serving old data.<sup><\/sup> 2026 CDNs use <strong>Instant Purging<\/strong> via Surrogate Keys (also called Cache Tags).<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Surrogate Keys:<\/strong> When your <strong>mybox<\/strong> server sends a page, it adds a header: <code>Surrogate-Key: product_405, category_shoes<\/code>.<\/li>\n\n\n\n<li><strong>Instant Update:<\/strong> If you change the price of that product, your server sends one API call to the CDN: <code>PURGE product_405<\/code>.<\/li>\n\n\n\n<li><strong>Consistency:<\/strong> Every page that features that product (homepage, category list, product page) is cleared instantly (usually in &lt;150ms) without clearing your <em>entire<\/em> site cache.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Security_Protecting_the_Private_Edge\"><\/span><strong>5. Security: Protecting the Private Edge<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Authenticated Origin Pulls:<\/strong> Ensure that your <strong>mybox<\/strong> origin <em>only<\/em> talks to the CDN. This prevents attackers from finding your IP and bypassing your security\/cache rules.<\/li>\n\n\n\n<li><strong>TLS 1.3 &amp; HSTS:<\/strong> Force modern encryption at the edge. In 2026, 0-RTT (Zero Round-Trip Time) resumes connections faster, significantly improving the &#8220;snappiness&#8221; of your store for returning users.<\/li>\n\n\n\n<li><strong>Rate Limiting:<\/strong> Protect your dynamic fragments. Even if the main page is cached, a bot could spam your <code>\/cart<\/code> fragment. Set a strict Rate Limit on all non-cacheable paths.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span><strong>Summary<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Dynamic content delivery on <strong>mybox<\/strong> in 2026 is about <strong>fragmentation<\/strong> and <strong>intelligent keys<\/strong>. By using ESI or Edge Workers for small personal details and Surrogate Keys for instant updates, you can keep your cache hit ratio high and your TTFB low. You no longer have to choose between &#8220;Personalized&#8221; and &#8220;Fast&#8221;\u2014at the edge, they are one and the same.<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[25,58],"manual_kb_tag":[6188,9496,9497,9498,9499,9500,9501,9502,9503,9504],"class_list":["post-7699","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-hosting","manualknowledgebasecat-web-applications-cms","manual_kb_tag-edge-computing","manual_kb_tag-programmable-edge","manual_kb_tag-edge-workers","manual_kb_tag-edge-assembly","manual_kb_tag-fragment-caching","manual_kb_tag-edge-side-includes","manual_kb_tag-parallel-fetching","manual_kb_tag-cache-keys","manual_kb_tag-cache-key-normalization","manual_kb_tag-cache-fragmentation"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7699\/revisions"}],"predecessor-version":[{"id":7700,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/7699\/revisions\/7700"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=7699"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=7699"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=7699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}