World is now on Opti ID! Learn more

Jonas Bergqvist
Feb 27, 2025
  633
(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
Troubleshooting Optimizely Shortcuts: Why PageShortcutLink Threw an Error and the Solution

As developers working with Optimizely, we often encounter unique challenges that push us to explore the platform's depths. Recently, I tackled a...

Amit Mittal | Jul 9, 2025

Commerce 14.41 delisted from Nuget feed

We have decided to delist version 14.41 of the Commerce packages as we have discovered a bug that prevents current carts to be saved into...

Shahrukh Ikhtear | Jul 8, 2025

How Optimizely SaaS CMS Isn’t Just Another Commodity

CMS platforms these days are becoming commoditised. The modelling of most systems lends itself to automation. Giving marketers more flexibility wit...

Chuhukon | Jul 4, 2025 |

How to Set Up CI/CD Pipeline for Optimizely Frontend Hosting Using GitHub Actions

As I promised in my previous blog post about getting started with Optimizely Frontend Hosting, today I’m delivering on that promise by sharing how ...

Szymon Uryga | Jul 2, 2025