{"id":31893,"date":"2025-05-27T18:26:32","date_gmt":"2025-05-27T23:26:32","guid":{"rendered":"https:\/\/wpengine.com\/builders\/?p=31893"},"modified":"2025-05-27T18:26:33","modified_gmt":"2025-05-27T23:26:33","slug":"wpgraphql-smart-cache-on-wp-engine","status":"publish","type":"post","link":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/","title":{"rendered":"Using WPGraphQL Smart Cache on WP Engine"},"content":{"rendered":"\n<p>Like in Spider-Man, the great power of headless WordPress is also a great responsibility. The extra control means we\u2019re just as likely to build sites that are slower, not faster, than their WordPress counterparts.<\/p>\n\n\n\n<p>There are many valuable tools for optimizing performance, but in this article, we\u2019ll discuss WP GraphQL Smart Cache, specifically as it relates to leveraging Smart Cache Network Caching on WP Engine\u2019s Managed Hosting for WordPress.<\/p>\n\n\n\n<p>If you\u2019re not familiar with how WP GraphQL Smart Cache works, I recommend reading the <a href=\"https:\/\/www.wpgraphql.com\/2022\/12\/20\/introducing-wpgraphql-smart-cache\">announcement post<\/a> about its release. Understanding the basic concepts of tag-based cache invalidation, persisted queries, and network caching will be important.<\/p>\n\n\n\n<p>General familiarity with <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Reference\/Headers\/Cache-Control\"><code>Cache-Control<\/code> headers<\/a> and <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Guides\/Caching\">HTTP Caching<\/a> will also be valuable.<\/p>\n\n\n\n<div class=\"wp-block-group has-polar-background-color has-background is-layout-flow wp-container-core-group-is-layout-1 wp-block-group-is-layout-flow\" style=\"padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--40)\">\n<p class=\"has-large-font-size\"><strong>Table of Contents<\/strong><\/p>\n\n\n\n<ul id=\"Prerequisites\" class=\"wp-block-list\">\n<li><a href=\"#open-source-software\">Open Source Software<\/a><\/li>\n\n\n\n<li><a href=\"#opting-out\">Opting Out<\/a><\/li>\n\n\n\n<li><a href=\"#layers\">Caching has layers, like an Ogre!<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#client-cache\">Client Cache<\/a><\/li>\n\n\n\n<li><a href=\"#cdn-cache\">CDN Cache<\/a><\/li>\n\n\n\n<li><a href=\"#server-cache\">Server Cache<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#scenario-1\">The default scenario<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#scenario-1-walkthrough\">Walkthrough<\/a><\/li>\n\n\n\n<li><a href=\"#scenario-1-improvements\">Improvements<\/a><\/li>\n\n\n\n<li><a href=\"#scenario-1-solution\">Solution<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#scenario-2\">EFPC Scenario<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#scenario-2-walkthrough\">Walkthrough<\/a><\/li>\n\n\n\n<li><a href=\"#scenario-2-improvements\">Improvements<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#tldr\">TL;DR<\/a>\n<ul class=\"wp-block-list\">\n<li><a href=\"#tldr-varnish\">Varnish<\/a><\/li>\n\n\n\n<li><a href=\"#tldr-efpc\">EFPC<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ul>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"open-source-software\">Open Source Software<\/h2>\n\n\n\n<p>As we get started, I&#8217;d like to clarify quickly that WPGraphQL Smart Cache is not a product of WP Engine. It\u2019s open-source software, maintained by a community of developers, in which WP Engine participates.<\/p>\n\n\n\n<p>The Smart Cache plugin is also not solely responsible for caching your GraphQL responses. While it enables the needed features in WordPress and WPGraphQL, the actual caches and their integration with the plugin are dependent on hosting providers.<\/p>\n\n\n\n<p>This means that the WPGraphQL caching experience described below is affected by the plugin, WP Engine\u2019s integration, third-party cache providers (Cloudflare, Varnish), etc.&nbsp;<\/p>\n\n\n\n<p>Oh, and remember how the two hardest things in software are caching and caching!<\/p>\n\n\n\n<p>We at WP Engine would like to see this experience improved and will continue to advocate for and work towards improving it. But there are some things we don\u2019t control. Even if we do, seemingly simple changes can affect caching for all of our customers, headless and traditional.&nbsp;<\/p>\n\n\n\n<p>We hope the following helps you understand the current state of our platform and how you can control the caching experience to suit the needs of your headless application.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"opting-out\">Opting Out<\/h2>\n\n\n\n<p>Quick review on leveraging the network cache. To enable network caching, the first and only completely required step is to change your GraphQL client from using POST requests to GET requests.<\/p>\n\n\n\n<p>If you need to disable caching for specific queries, your best solution is always to switch those requests back to HTTP POST requests (this assumes you\u2019re not using Smart Cache\u2019s object caching feature).<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>If you\u2019re using <a href=\"http:\/\/faust.js\">Faust.js<\/a>, you can read the docs on the <a href=\"https:\/\/faustjs.org\/docs\/how-to\/use-wpgraphql-smart-cache\/#4-making-network-requests\">basics of using network caching<\/a>.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"layers\">Caching has layers, like an Ogre!<\/h2>\n\n\n\n<p>On the WP Engine platform, all requests go through a minimum of two layers of caching. However, events from WordPress, via Smart Cache, purge only one cache.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"client-cache\">Client Cache<\/h3>\n\n\n\n<p>This could be the user&#8217;s browser or your headless application server. Whatever the source, these caches usually operate independently of Smart Cache and thus solely rely on the TTL and cache-control headers to determine caching.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"cdn-cache\">CDN Cache<\/h3>\n\n\n\n<p>The next possible cache is WP Engine\u2019s Advanced Network(AN), powered by Cloudflare. By default, this will not cache GraphQL responses. Cloudflare considers HTML and JSON responses dynamic, and thus uncachable, without additional configuration. To resolve this, WP Engine recently introduced the <a href=\"https:\/\/wpengine.com\/blog\/faster-site-speed-edge-full-page-cache\/\">Edge Full Page Cache<\/a> (EFPC) \u2013 a feature of AN that enables caching HTML and JSON responses.\u00a0<\/p>\n\n\n\n<p>Enabling EFPC means our GraphQL responses are now being cached on the edge. However, EFPC does not cache based on keys and is not purged by Smart Cache. It must rely on the configured TTL.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"server-cache\">Server Cache<\/h3>\n\n\n\n<p>Third, all WP Engine WordPress sites have a Varnish server cache. Varnish is the only place (other than the object cache) where Smart Cache purges data. Varnish also uses the configured TTL as a fallback.<\/p>\n\n\n\n<figure class=\"wp-block-image is-style-default\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeEaFEl6PY8HeXWKKhtzLYuLwDJkCF-XIR2qvD1pxeotjRsQEfAi_53BQRUe59n3SQTAPA1XQP7A8MHORN_wGhGLiomzZLq_KMWDq_ChOKD6iw1qt_i58HPOXvszSZQcWhCeDE9?key=Rzb3ln1J3bCRvcGh6qCfzA\" alt=\"Flow diagram illustrating the described cache and cache invalidation mechanisms.\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>The fallback TTL is important for caches that don&#8217;t receive purge events. It\u2019s also important because Smart Cache isn\u2019t perfect. Settings, in particular, don\u2019t yet purge cache but can affect GraphQL responses.<\/p>\n<\/blockquote>\n\n\n\n<p>These are the only caches that affect the WordPress side of things. Your headless application might have its own GraphQL cache. Pages can also be cached by frameworks or Cloudflare based on the <code>Cache-Control<\/code> header. The networks your site visitors are coming from may also have their own network caching layer. All of these are likely to rely on that configured TTL.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Cache<\/th><th>Caches GraphQL responses<\/th><th>TTL Config<\/th><th>Tag-based cache invalidation<\/th><th>Time-based cache invalidation<\/th><\/tr><\/thead><tbody><tr><td><strong>Browser<\/strong><\/td><td>YES<\/td><td><code>Cache-Control<\/code><\/td><td>NO<\/td><td>YES<\/td><\/tr><tr><td><strong>Advanced Network<\/strong><\/td><td>CONFIGURABLE<\/td><td><code>Cache-Control<\/code>, <code>CDN-Cache-Control<\/code><\/td><td>NO<\/td><td>YES<\/td><\/tr><tr><td><strong>Varnish<\/strong><\/td><td>YES<\/td><td><code>Cache-Control<\/code><\/td><td>YES<\/td><td>YES<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Now that we (hopefully) understand the complex layers of cache involved and how they interact with smart cache, we can work towards an acceptable configuration of each of these layers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"scenario-1\">The default scenario<\/h2>\n\n\n\n<p>Let\u2019s work through a scenario. The site is on WP Engine, the GraphQL client is configured correctly, and we have default settings in Smart Cache. We\u2019ll assume our three caching layers are the browser, Cloudflare, and Varnish.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"scenario-1-walkthrough\">Walkthrough<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Layer<\/th><th>First request ever from Visitor A<\/th><th>Nth response from Visitor B<\/th><\/tr><\/thead><tbody><tr><td><strong>Browser<\/strong><\/td><td>MISS<\/td><td>MISS<\/td><\/tr><tr><td><strong>Cloudflare<\/strong><\/td><td>DYNAMIC<\/td><td>DYNAMIC<\/td><\/tr><tr><td><strong>Varnish<\/strong><\/td><td>MISS<\/td><td>HIT: N<\/td><\/tr><tr><td><strong>Server<\/strong><\/td><td>Responds<\/td><td>\u2013<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Both visitors\u2019 browsers don\u2019t have a cache, so the response is sent to Cloudflare. Cloudflare responds with <code>DYNAMIC<\/code> cause it\u2019s considered uncacheable content (EFPC is not enabled yet). The first request misses Varnish, and the server responds. Visitor B\u2019s request hits Varnish.<\/p>\n\n\n\n<p>By default, Smart Cache with the help of Varnish will cache this response for 600 seconds (10 minutes) or until a tag-based purge event happens for the data, whichever comes first. Smart Cache settings can adjust this TTL.<\/p>\n\n\n\n<p>If either of these visitors requests this again, before the 600s have elapsed, their browser caches will be used. If it\u2019s past the 600s or a new user requests data after a purge event has happened, then the scenario starts from the beginning. Any new visitors will continue to receive hits from Varnish.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"scenario-1-improvements\">Improvements<\/h3>\n\n\n\n<p>This is a powerful and relatively simple caching config. This will help us scale significantly. Varnish response times are roughly an order of magnitude faster than the server (i.e., ~2s =&gt; ~200ms).&nbsp;<\/p>\n\n\n\n<p>However, this configuration can be improved. The browser and Varnish TTL are the same. This means the browser cache will continue serving stale data for 600s even if Smart Cache invalidates the data in Varnish due to a purge event.&nbsp;<\/p>\n\n\n\n<p>We could lower the TTL, but this would theoretically affect Varnish, lowering the overall cache hit rate. However, there\u2019s a quirk in WP Engine\u2019s Varnish config. It doesn\u2019t let you set a TTL lower than 600s. You can set one higher, but not lower.&nbsp;<\/p>\n\n\n\n<p>This actually helps us here. If we set our TTL to 60s, then quick page navigations will use the browser cache, but otherwise, Varnish will serve fresh data.<\/p>\n\n\n\n<p>What if we want to raise the varnish TTL(better hit rates) while lowering the browser TTL? We\u2019re out of luck. At this time, Smart Cache sets the header as <code>max-age={TTL}, s-maxage={TTL}, must-revalidate<\/code>. If we could set <code>s-maxage<\/code> differently, then we might be able to do this. Unfortunately, from the UI, this isn\u2019t possible. This is possible with the <a href=\"https:\/\/www.wpgraphql.com\/filters\/graphql_response_headers_to_send\"><code>graphql_response_headers_to_send<\/code> filter<\/a> from PHP.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"scenario-1-solution\">Solution<\/h3>\n\n\n\n<p>Another option would be to use WP Engine <a href=\"https:\/\/wpengine.com\/support\/web-rules-engine\/\">Web Rules<\/a>. These rules allow us to add\/change headers, which are applied after Varnish. This means we can configure a web rule to set a new <code>Cache-Control<\/code> header that won\u2019t affect Varnish.<\/p>\n\n\n\n<p>This new header will be used by Cloudflare, the browser, and other miscellaneous caches.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXdFjHvFH3Fqmem23Po1wFBQ3NkHqKKD9gWLGsfwpnUusfcRm3M1FfbGrGLo66_od-69qBSFQTs2G_umW7u-qSngU7IUZ9b8IciYiV4xTBibD9kImzJjRe7FjOjSuJH4vQBCr3AHvA?key=Rzb3ln1J3bCRvcGh6qCfzA\" alt=\"\"\/><\/figure>\n\n\n\n<p>This allows us to set <code>max-age<\/code> or <code>s-maxage<\/code> as we please. Our settings in Smart Cache only affect Varnish TTLs. Thus, those can now be raised while other caches can be lowered. This means more data in our cache, higher hit rates, and fewer stale cache responses. Fran would be so stoked; honestly, I am too!<\/p>\n\n\n\n<p>The example above shows a <code>Cache-Control<\/code> header that is the same for all GraphQL responses. Using the different headers Smart Cache sets and their values, it is possible to get very granular in setting different headers by post type, query, and more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"scenario-2\">Edge Full Page Cache Scenario<\/h2>\n\n\n\n<p>For our next scenario, let\u2019s add in EFPC. Same config we left off with.&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"scenario-2-walkthrough\">Walkthrough<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Layer<\/th><th>First request ever from Visitor A<\/th><th>Nth response from Visitor B<\/th><\/tr><\/thead><tbody><tr><td><strong>Browser<\/strong><\/td><td>MISS<\/td><td>MISS<\/td><\/tr><tr><td><strong>Cloudfare<\/strong><\/td><td>MISS<\/td><td>HIT<\/td><\/tr><tr><td><strong>Varnish<\/strong><\/td><td>MISS<\/td><td>HIT: N<\/td><\/tr><tr><td><strong>Server<\/strong><\/td><td>Responds<\/td><td>\u2013<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Now that Cloudflare knows how to cache JSON with EFPC, we will start receiving HIT responses. Remember, EFPC fully relies on our TTLs to invalidate this data. But once the data goes stale will request and update from our server stack where Varnish can respond.<\/p>\n\n\n\n<p>After 700 seconds, a visitor would get a <code>stale<\/code> response from Cloudflare, but Varnish would respond with a HIT: N+1. Only once Varnish receives a purge event or the data expires would our request have to go all the way to the server. In the meantime, CF makes sure it stays fresh. Any additional Cloudflare points of presence can also be primed with data from the Varnish cache.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"scenario-2-improvements\">Improvements<\/h3>\n\n\n\n<p>This is a nice improvement, and we\u2019ve reduced our latency by roughly another order of magnitude (i.e., ~200ms => ~20ms). With this config, we can control the browser and Cloudflare separately using <code>max-age<\/code> and <code>s-maxage<\/code> respectively. Awesome!<\/p>\n\n\n\n<p>The final improvement we may choose to make is to control Cloudflare differently than any other downstream shared cache. Whether it&#8217;s a network cache we don\u2019t control or something in our headless application, Cloudflare also respects <a href=\"https:\/\/developers.cloudflare.com\/cache\/concepts\/cdn-cache-control\/\">alternative headers<\/a>. You can opt to use <code>CDN-Cache-Control<\/code> to target Cloudflare.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"tldr\">TL;DR<\/h2>\n\n\n\n<p>Here are the various subtle quirks of working with caches on the WP Smart Cache on the WP Engine platform.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"tldr-varnish\">Varnish<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Purged by events or TTL, whichever comes first.<\/li>\n\n\n\n<li><code>cache-control<\/code> headers from WP get moved to <code>x-orig-cache-control<\/code> and overridden<\/li>\n\n\n\n<li>Sending requests with <code>x-wpe-no-cache: true<\/code> generally disables the Varnish cache. But doesn\u2019t affect AN\/EFPC. Varnish ignores <code>Cache-Control: no-cache<\/code> directives<\/li>\n\n\n\n<li>Varnish resets TTLs from Smart Cache below 600s to 600s.<\/li>\n\n\n\n<li>TTLs over 600 are respected, but the cache control header is modified to always be <code>max-age: {ttl}, must-revalidate<\/code>; everything else is stripped. \ud83d\ude44<\/li>\n\n\n\n<li>Web rules can be used to modify headers, but this happens AFTER Varnish. For example, you can set the cache control headers you want, but Varnish still follows the TTLs from Smart Cache.<\/li>\n\n\n\n<li>Will not cache POST requests<\/li>\n\n\n\n<li>When a page is configured to be your \u201cHome\u201d page in WordPress, editing that page will purge the entire domain in Varnish.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"tldr-efpc\">EFPC<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Not Purged by events, only TTL.<\/li>\n\n\n\n<li><code>Cache-Control<\/code>, <code>CDN-Cache-Control<\/code>, and <code>Cloudflare-CDN-Cache-Control<\/code> headers can all be used to configure it. CF only uses the most specific of these headers, not a combination of all of them.<\/li>\n\n\n\n<li><a href=\"https:\/\/community.cloudflare.com\/t\/request-no-cache-header-is-ignored-by-cloudflare\/201653\">Cloudflare ignores<\/a> the request directives of <code>Cache-Control: no-cache<\/code> to bypass the cache.<\/li>\n\n\n\n<li>Will not cache POST requests<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>I hope you better understand the complexities of caching with WPGraphQL Smart Cache and the WP Engine Managed Hosting Platform for WordPress.<\/p>\n\n\n\n<p>If you&#8217;re struggling with these workarounds or find any quirks we didn&#8217;t list here, please pass them along to support, your account rep, or find us in the <a href=\"https:\/\/faustjs.org\/discord\">Headless Discord<\/a>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like in Spider-Man, the great power of headless WordPress is also a great responsibility. The extra control means we\u2019re just as likely to build sites that are slower, not faster, [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_EventAllDay":false,"_EventTimezone":"","_EventStartDate":"","_EventEndDate":"","_EventStartDateUTC":"","_EventEndDateUTC":"","_EventShowMap":false,"_EventShowMapLink":false,"_EventURL":"","_EventCost":"","_EventCostDescription":"","_EventCurrencySymbol":"","_EventCurrencyCode":"","_EventCurrencyPosition":"","_EventDateTimeSeparator":"","_EventTimeRangeSeparator":"","_EventOrganizerID":[],"_EventVenueID":[],"_OrganizerEmail":"","_OrganizerPhone":"","_OrganizerWebsite":"","_VenueAddress":"","_VenueCity":"","_VenueCountry":"","_VenueProvince":"","_VenueState":"","_VenueZip":"","_VenuePhone":"","_VenueURL":"","_VenueStateProvince":"","_VenueLat":"","_VenueLng":"","_VenueShowMap":false,"_VenueShowMapLink":false,"footnotes":""},"categories":[23],"tags":[],"class_list":["post-31893","post","type-post","status-publish","format-standard","hentry","category-headless"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Using WPGraphQL Smart Cache on WP Engine - Builders<\/title>\n<meta name=\"description\" content=\"WPGraphQL Smart Cache and the WP Engine keep your headless site fast and consistent. Learn how to avoid pitfalls and maximize the tools!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using WPGraphQL Smart Cache on WP Engine\" \/>\n<meta property=\"og:description\" content=\"WPGraphQL Smart Cache and the WP Engine keep your headless site fast and consistent. Learn how to avoid pitfalls and maximize the tools!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/\" \/>\n<meta property=\"og:site_name\" content=\"Builders\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-27T23:26:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-27T23:26:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2025\/05\/WPE-Builders-Contributing-to-\u2028Open-Source-Projects-1920x1080-1-1024x576.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alex Moon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@moon_meister\" \/>\n<meta name=\"twitter:site\" content=\"@wpebuilders\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alex Moon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/\"},\"author\":{\"name\":\"Alex Moon\",\"@id\":\"https:\/\/wpengine.com\/builders\/#\/schema\/person\/868e9d9f8b846000f45cc7a25f46255a\"},\"headline\":\"Using WPGraphQL Smart Cache on WP Engine\",\"datePublished\":\"2025-05-27T23:26:32+00:00\",\"dateModified\":\"2025-05-27T23:26:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/\"},\"wordCount\":1853,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/wpengine.com\/builders\/#organization\"},\"image\":{\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeEaFEl6PY8HeXWKKhtzLYuLwDJkCF-XIR2qvD1pxeotjRsQEfAi_53BQRUe59n3SQTAPA1XQP7A8MHORN_wGhGLiomzZLq_KMWDq_ChOKD6iw1qt_i58HPOXvszSZQcWhCeDE9?key=Rzb3ln1J3bCRvcGh6qCfzA\",\"articleSection\":[\"Headless\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/\",\"url\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/\",\"name\":\"Using WPGraphQL Smart Cache on WP Engine - Builders\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/builders\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeEaFEl6PY8HeXWKKhtzLYuLwDJkCF-XIR2qvD1pxeotjRsQEfAi_53BQRUe59n3SQTAPA1XQP7A8MHORN_wGhGLiomzZLq_KMWDq_ChOKD6iw1qt_i58HPOXvszSZQcWhCeDE9?key=Rzb3ln1J3bCRvcGh6qCfzA\",\"datePublished\":\"2025-05-27T23:26:32+00:00\",\"dateModified\":\"2025-05-27T23:26:33+00:00\",\"description\":\"WPGraphQL Smart Cache and the WP Engine keep your headless site fast and consistent. Learn how to avoid pitfalls and maximize the tools!\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#primaryimage\",\"url\":\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeEaFEl6PY8HeXWKKhtzLYuLwDJkCF-XIR2qvD1pxeotjRsQEfAi_53BQRUe59n3SQTAPA1XQP7A8MHORN_wGhGLiomzZLq_KMWDq_ChOKD6iw1qt_i58HPOXvszSZQcWhCeDE9?key=Rzb3ln1J3bCRvcGh6qCfzA\",\"contentUrl\":\"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeEaFEl6PY8HeXWKKhtzLYuLwDJkCF-XIR2qvD1pxeotjRsQEfAi_53BQRUe59n3SQTAPA1XQP7A8MHORN_wGhGLiomzZLq_KMWDq_ChOKD6iw1qt_i58HPOXvszSZQcWhCeDE9?key=Rzb3ln1J3bCRvcGh6qCfzA\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/builders\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using WPGraphQL Smart Cache on WP Engine\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/builders\/#website\",\"url\":\"https:\/\/wpengine.com\/builders\/\",\"name\":\"Builders\",\"description\":\"Reimagining the way we build with WordPress.\",\"publisher\":{\"@id\":\"https:\/\/wpengine.com\/builders\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/builders\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/wpengine.com\/builders\/#organization\",\"name\":\"WP Engine\",\"url\":\"https:\/\/wpengine.com\/builders\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png\",\"contentUrl\":\"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png\",\"width\":348,\"height\":68,\"caption\":\"WP Engine\"},\"image\":{\"@id\":\"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/wpebuilders\",\"https:\/\/www.youtube.com\/channel\/UCh1WuL54XFb9ZI6m6goFv1g\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/builders\/#\/schema\/person\/868e9d9f8b846000f45cc7a25f46255a\",\"name\":\"Alex Moon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/builders\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/999d8bf58fa6790945f2aff83a31c3df?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/999d8bf58fa6790945f2aff83a31c3df?s=96&d=mm&r=g\",\"caption\":\"Alex Moon\"},\"description\":\"Alex Moon is a Developer Advocate at WP Engine. He's been working in Open Source for over a decade and headless WordPress since the early days of WP GraphQL. When he's not writing code he's often found in the mountains or sailing the seas. Follow him on X or Bluesky for more headless WordPress goodness!\",\"sameAs\":[\"https:\/\/gurugoes.net\",\"https:\/\/x.com\/moon_meister\"],\"url\":\"https:\/\/wpengine.com\/builders\/author\/alexmoon-2-2-2-2-2-2-2-2-2-2-2\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using WPGraphQL Smart Cache on WP Engine - Builders","description":"WPGraphQL Smart Cache and the WP Engine keep your headless site fast and consistent. Learn how to avoid pitfalls and maximize the tools!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/","og_locale":"en_US","og_type":"article","og_title":"Using WPGraphQL Smart Cache on WP Engine","og_description":"WPGraphQL Smart Cache and the WP Engine keep your headless site fast and consistent. Learn how to avoid pitfalls and maximize the tools!","og_url":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/","og_site_name":"Builders","article_published_time":"2025-05-27T23:26:32+00:00","article_modified_time":"2025-05-27T23:26:33+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2025\/05\/WPE-Builders-Contributing-to-\u2028Open-Source-Projects-1920x1080-1-1024x576.png","type":"image\/png"}],"author":"Alex Moon","twitter_card":"summary_large_image","twitter_creator":"@moon_meister","twitter_site":"@wpebuilders","twitter_misc":{"Written by":"Alex Moon","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#article","isPartOf":{"@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/"},"author":{"name":"Alex Moon","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/person\/868e9d9f8b846000f45cc7a25f46255a"},"headline":"Using WPGraphQL Smart Cache on WP Engine","datePublished":"2025-05-27T23:26:32+00:00","dateModified":"2025-05-27T23:26:33+00:00","mainEntityOfPage":{"@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/"},"wordCount":1853,"commentCount":0,"publisher":{"@id":"https:\/\/wpengine.com\/builders\/#organization"},"image":{"@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#primaryimage"},"thumbnailUrl":"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeEaFEl6PY8HeXWKKhtzLYuLwDJkCF-XIR2qvD1pxeotjRsQEfAi_53BQRUe59n3SQTAPA1XQP7A8MHORN_wGhGLiomzZLq_KMWDq_ChOKD6iw1qt_i58HPOXvszSZQcWhCeDE9?key=Rzb3ln1J3bCRvcGh6qCfzA","articleSection":["Headless"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/","url":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/","name":"Using WPGraphQL Smart Cache on WP Engine - Builders","isPartOf":{"@id":"https:\/\/wpengine.com\/builders\/#website"},"primaryImageOfPage":{"@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#primaryimage"},"image":{"@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#primaryimage"},"thumbnailUrl":"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeEaFEl6PY8HeXWKKhtzLYuLwDJkCF-XIR2qvD1pxeotjRsQEfAi_53BQRUe59n3SQTAPA1XQP7A8MHORN_wGhGLiomzZLq_KMWDq_ChOKD6iw1qt_i58HPOXvszSZQcWhCeDE9?key=Rzb3ln1J3bCRvcGh6qCfzA","datePublished":"2025-05-27T23:26:32+00:00","dateModified":"2025-05-27T23:26:33+00:00","description":"WPGraphQL Smart Cache and the WP Engine keep your headless site fast and consistent. Learn how to avoid pitfalls and maximize the tools!","breadcrumb":{"@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#primaryimage","url":"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeEaFEl6PY8HeXWKKhtzLYuLwDJkCF-XIR2qvD1pxeotjRsQEfAi_53BQRUe59n3SQTAPA1XQP7A8MHORN_wGhGLiomzZLq_KMWDq_ChOKD6iw1qt_i58HPOXvszSZQcWhCeDE9?key=Rzb3ln1J3bCRvcGh6qCfzA","contentUrl":"https:\/\/lh7-rt.googleusercontent.com\/docsz\/AD_4nXeEaFEl6PY8HeXWKKhtzLYuLwDJkCF-XIR2qvD1pxeotjRsQEfAi_53BQRUe59n3SQTAPA1XQP7A8MHORN_wGhGLiomzZLq_KMWDq_ChOKD6iw1qt_i58HPOXvszSZQcWhCeDE9?key=Rzb3ln1J3bCRvcGh6qCfzA"},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/builders\/wpgraphql-smart-cache-on-wp-engine\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/builders\/"},{"@type":"ListItem","position":2,"name":"Using WPGraphQL Smart Cache on WP Engine"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/builders\/#website","url":"https:\/\/wpengine.com\/builders\/","name":"Builders","description":"Reimagining the way we build with WordPress.","publisher":{"@id":"https:\/\/wpengine.com\/builders\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/builders\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/wpengine.com\/builders\/#organization","name":"WP Engine","url":"https:\/\/wpengine.com\/builders\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/","url":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png","contentUrl":"https:\/\/wpengine.com\/builders\/wp-content\/uploads\/2024\/05\/WP-Engine-Horizontal@2x.png","width":348,"height":68,"caption":"WP Engine"},"image":{"@id":"https:\/\/wpengine.com\/builders\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/wpebuilders","https:\/\/www.youtube.com\/channel\/UCh1WuL54XFb9ZI6m6goFv1g"]},{"@type":"Person","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/person\/868e9d9f8b846000f45cc7a25f46255a","name":"Alex Moon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/builders\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/999d8bf58fa6790945f2aff83a31c3df?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/999d8bf58fa6790945f2aff83a31c3df?s=96&d=mm&r=g","caption":"Alex Moon"},"description":"Alex Moon is a Developer Advocate at WP Engine. He's been working in Open Source for over a decade and headless WordPress since the early days of WP GraphQL. When he's not writing code he's often found in the mountains or sailing the seas. Follow him on X or Bluesky for more headless WordPress goodness!","sameAs":["https:\/\/gurugoes.net","https:\/\/x.com\/moon_meister"],"url":"https:\/\/wpengine.com\/builders\/author\/alexmoon-2-2-2-2-2-2-2-2-2-2-2\/"}]}},"_links":{"self":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts\/31893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/comments?post=31893"}],"version-history":[{"count":0,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/posts\/31893\/revisions"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/media?parent=31893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/categories?post=31893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpengine.com\/builders\/wp-json\/wp\/v2\/tags?post=31893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}