London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Jonas Bergqvist
Feb 27, 2025
  392
(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
Routing to a page in SaaS CMS

More early findings from using a SaaS CMS instance; setting up Graph queries that works for both visitor pageviews and editor previews.

Johan Kronberg | Apr 14, 2025 |

Developer Meetup - London, 24th April 2025

Next Thursday, 24th April will be Candyspace 's first Optimizely Developer Meetup, and the first one held in London this year! We've have some...

Gavin_M | Apr 14, 2025

Successful Digitalization for SMEs: How Optimizely One can Revolutionize Your Business Processes

"Achieve digital excellence with Optimizely One: Boost efficiency, delight customers, secure growth." In today's digital world, it's crucial for...

Frank Hohmeyer | Apr 11, 2025

Personalized Optimizely CMS Website Search Experiences Azure AI Search & Personalizer

In the last blog, we discussed Integrating the Optimizely CMS website with Azure AI search. Now let’s take a bit more advanced topic to serve...

Naveed Ul-Haq | Apr 10, 2025 |