Take the community feedback survey now.

Jonas Bergqvist
Feb 27, 2025
  832
(2 votes)

Boosting Graph Query Performance with Cached Templates

To optimize query performance, Cached Templates pre-process and caches translated queries as templates. The initial execution of a query generates a template with placeholders for variable values. This eliminates the need for repeated translation when the same query structure is used with different variables, resulting in substantial performance improvements.

Cached Templates can be activated by adding the stored=true query string parameter and the cg-stored-query: template header to your requests. The service will handle template generation and caching automatically, improving the efficiency of subsequent requests. This feature will be enabled for all requests automatically later this year.

The system supports the following variable types for cached templates: Boolean, Date, DateTime, String, Int, Float, Locales, and [Locales]. For Locales and [Locales] types, the variable name is required to be 'locale'. Any other variable types will result in a fallback to 'Cached Queries'.

Cached Queries, similar to Cached Templates, improve performance by caching fully resolved queries. They act as a backup for queries incompatible with Cached Templates.

These features are a major step towards optimized Graph query performance, ensuring faster applications and a better user experience.

 

Feb 27, 2025

Comments

Please login to comment.
Latest blogs
Dynamic CSP Management for Headless and Hybrid Optimizely CMS with Next.js

In the evolving realm of web security, Content Security Policy (CSP) is essential for defending against XSS and injection attacks. Traditional...

Minesh Shah (Netcel) | Sep 8, 2025

Create a Simple home page in Optimizely CMS

  Introduction In this blog post, I will walk you through a step by step process to create a very basic home page on a Optimizley CMS Empty site....

Ratish | Sep 7, 2025 |

AEO, GEO and SEO with Epicweb AI-Assistant in Optimizely

As search evolves beyond traditional SEO, businesses must adapt to Answer Engine Optimization (AEO) and Generative Engine Optimization (GEO). This...

Luc Gosso (MVP) | Sep 7, 2025 |

Meet the newest OMVPs – summer 2025 cohort

We’re excited to welcome the latest group of Optimizely Most Valuable Professionals (OMVPs) into the program! This summer’s cohort highlights a ble...

Satata Satez | Sep 5, 2025