v.25.11Improvement
HTTP interface will provide Age and Expires
The HTTP interface will provideAgeandExpiresheaders when the query result cache is used. The presence of theAgeheader tells whether the result is from the cache, whileExpiresis also set at the first write. Introduce new profile events:QueryCacheAgeSeconds,QueryCacheReadRows,QueryCacheReadBytes,QueryCacheWrittenRows,QueryCacheWrittenBytes. #89759 (Alexey Milovidov).
Why it matters
This feature enables users to identify when query results are served from the cache by checking theAge header and understand cache expiration via the Expires header. Additionally, the new profile events provide detailed metrics about cache usage, such as the age of cached results and the number of rows and bytes read from or written to the cache. This improves observability and helps optimize query performance by leveraging cached results more effectively.How to use it
When using the HTTP interface, monitor theAge and Expires headers in the HTTP response to determine cache usage and validity. Use the new profile events QueryCacheAgeSeconds, QueryCacheReadRows, QueryCacheReadBytes, QueryCacheWrittenRows, and QueryCacheWrittenBytes in query profiling to analyze cache behavior and performance.