Skip to content

fix: share inter-query cache across all queries in an Engine - #1423

Merged
jalseth merged 1 commit into
masterfrom
fix/inter-query-cache-per-engine
Sep 19, 2026
Merged

jalseth merged 1 commit into
masterfrom
fix/inter-query-cache-per-engine

Conversation

@jalseth

@jalseth jalseth commented Sep 13, 2026

Copy link
Copy Markdown
Member

The cache was created inside Engine.query, so every Rego query got a fresh empty cache and http.send results were never reused between rules or input files. Create the cache once in EnableInterQueryCache and reuse it.

Fixes #1085

@anderseknert anderseknert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few nits, but LGTM

Comment thread policy/engine_test.go Outdated
Comment thread policy/engine_test.go Outdated
The cache was created inside Engine.query, so every Rego query got a fresh
empty cache and http.send results were never reused between rules or input
files. Create the cache once in EnableInterQueryCache and reuse it.

Fixes #1085

Signed-off-by: James Alseth <james@jalseth.me>
@jalseth
jalseth force-pushed the fix/inter-query-cache-per-engine branch from 33b859d to 5071cc1 Compare September 19, 2026 16:24
@jalseth
jalseth merged commit f01cab0 into master Sep 19, 2026
13 checks passed
@jalseth
jalseth deleted the fix/inter-query-cache-per-engine branch September 19, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP Caching does not seem to function after enabling

2 participants