10.2. Query Compilation Cache
Prev | Chapter 10. Caching | Next

## 10.2. Query Compilation Cache

The query compilation cache is a `Map` used to cache parsed query strings. As a result, most queries are only parsed once in Kodo, and cached thereafter. You can control the compilation cache through the `kodo.QueryCompilationCache` configuration property. This property accepts a plugin string (see Section 2.5, “Plugin Configuration”) describing the `Map` used to associate query strings and their parsed form. This property accepts the following aliases:

Table 10.2. Pre-defined aliases

Alias | Value | Notes
--- | --- | ---
`true` | `kodo.util.CacheMap` | The default option. Uses a `CacheMap` to store compilation data. `CacheMap` uses a least-recently-used strategy for a fixed number of cache entries, and an optional soft reference map for entries that are moved out of the LRU space. So, for applications that have a monotonically increasing number of distinct queries, this option can be used to ensure that a fixed amount of memory is used by the cache.
`all` | `java.util.HashMap` | This is the fastest option, but compilation data is never dropped from the cache, so if you use a large number of dynamic queries, this option may result in ever-increasing memory usage. Note that if your queries only differ in the values of the parameters, this should not be an issue.
`false` | none | Disables the compilation cache.

Prev | Up | Next
Chapter 10. Caching | Home | Chapter 11. Remote and Offline Operation