Skip to content

[DOCs] Update cache configuration to support Redis-backed caching#2139

Open
KaveeshaPiumini wants to merge 1 commit intoasgardeo:mainfrom
KaveeshaPiumini:docs
Open

[DOCs] Update cache configuration to support Redis-backed caching#2139
KaveeshaPiumini wants to merge 1 commit intoasgardeo:mainfrom
KaveeshaPiumini:docs

Conversation

@KaveeshaPiumini
Copy link
Copy Markdown
Contributor

@KaveeshaPiumini KaveeshaPiumini commented Apr 2, 2026

Purpose

This pull request updates the cache configuration documentation to include support for Redis-backed caching in addition to the existing in-memory cache. The documentation now explains how to configure Redis as the cache backend and details the relevant settings.

Cache system enhancements:

  • Updated the cache configuration section to reflect support for both in-memory and Redis-backed caching, including new configuration options for Redis such as address, username, password, db, and key_prefix.
  • Added a dedicated "Redis Cache Configuration" section with an example YAML configuration and important notes on TTL handling and startup behavior if Redis is unavailable.

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • Documentation
    • Added Redis as an alternative to the in-memory cache in configuration docs.
    • Documented Redis connection, authentication, DB selection, and key-prefix settings.
    • Added per-cache overrides (name, disabled, size, ttl, eviction policy) with clear fallback behavior to global settings.
    • New “Redis Cache Configuration” section with YAML example, TTL/expiration notes, and startup behavior if Redis is unreachable.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Warning

Rate limit exceeded

@KaveeshaPiumini has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 57 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 7 minutes and 57 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 953cf11b-6a5b-4cc4-ac2d-4cdc5aa3d28f

📥 Commits

Reviewing files that changed from the base of the PR and between c2d779e and 9634b2d.

📒 Files selected for processing (1)
  • docs/content/guides/getting-started/configuration.mdx
📝 Walkthrough

Walkthrough

Documentation expanded to document Redis as a supported cache backend, add global Redis connection/key settings, introduce per-internal-cache overrides via cache.properties[], clarify FlowGraphCache is always in-memory, and add a "Redis Cache Configuration" subsection with example YAML and startup connectivity behavior.

Changes

Cohort / File(s) Summary
Cache Configuration Documentation
docs/content/guides/getting-started/configuration.mdx
Reworked cache docs to add cache.type: redis support, global Redis keys (cache.redis.address, cache.redis.username, cache.redis.password, cache.redis.db, cache.redis.key_prefix), cache.properties[] per-cache overrides (name, disabled, size, ttl, eviction_policy) with fallback to global cache.* values, clarified cache.cleanup_interval is in-memory-only, noted FlowGraphCache remains in-memory, explained Redis-specific behavior for TTL/size/eviction, added YAML example and startup connectivity warning that disables cache on Redis connect failure.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

Type/Improvement

Suggested reviewers

  • rajithacharith
  • ThaminduDilshan
  • ayeshajay
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: updating cache configuration documentation to support Redis-backed caching, which aligns with the primary objective of the pull request.
Description check ✅ Passed The description includes the Purpose section with clear explanation of changes, references a related issue, and partially completes the checklist. While some checklist items are unchecked, the description provides sufficient information about what is being changed and why.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/content/guides/getting-started/configuration.mdx`:
- Around line 157-159: Update the doc sentence "When Redis caching is enabled,
Thunder uses Redis native key expiration for TTL handling." by replacing the
word "expiration" with "TTL" to satisfy the Vale wording rule and align with
docs style; edit that sentence in the configuration guide so it reads something
like "When Redis caching is enabled, Thunder uses Redis native key TTL for key
handling" (or similar concise phrasing using "TTL") to maintain consistency with
existing documentation.
- Around line 129-134: The doc currently lists `cache.cleanup_interval` as a
general setting though the cleanup routine is only run for the in-memory cache;
update the table row for `cache.cleanup_interval` to state it is "In-memory only
(not used for `cache.type: redis`)" and optionally add a short note next to
`cache.type` or the `cache.properties[]` entry explaining that Redis does not
use the periodic cleanup routine. Reference the `cache.cleanup_interval` and
`cache.type` keys when making the change so readers know the backend-specific
applicability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ac19ef81-5111-47d2-9209-48e3e04c9915

📥 Commits

Reviewing files that changed from the base of the PR and between 5f897bf and 7c570f7.

📒 Files selected for processing (1)
  • docs/content/guides/getting-started/configuration.mdx

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.51%. Comparing base (e821980) to head (89dfc06).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2139      +/-   ##
==========================================
- Coverage   89.51%   89.51%   -0.01%     
==========================================
  Files         913      913              
  Lines       60289    60289              
==========================================
- Hits        53969    53965       -4     
- Misses       4694     4698       +4     
  Partials     1626     1626              
Flag Coverage Δ
backend-integration-postgres 53.23% <ø> (ø)
backend-integration-sqlite 53.23% <ø> (-0.04%) ⬇️
backend-unit 83.96% <ø> (-0.01%) ⬇️
frontend-apps-console-unit 90.14% <ø> (ø)
frontend-apps-gate-unit 97.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KaveeshaPiumini KaveeshaPiumini changed the title Update cache configuration to support Redis-backed caching [DOCs] Update cache configuration to support Redis-backed caching Apr 2, 2026
@KaveeshaPiumini KaveeshaPiumini added Type/Docs skip-changelog Skip generating changelog for a particular PR labels Apr 2, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (2)
docs/content/guides/getting-started/configuration.mdx (2)

133-133: ⚠️ Potential issue | 🟡 Minor

Clarify that cache.cleanup_interval applies to in-memory cache only.

The cache.cleanup_interval setting does not apply when cache.type is redis. Mark it as in-memory-only to prevent configuration confusion.

📝 Suggested clarification
-| `cache.cleanup_interval` | `300` | Interval in seconds to clean up expired entries |
+| `cache.cleanup_interval` | `300` | Interval in seconds to clean up expired entries (in-memory cache only) |

As per coding guidelines, docs/**: "Completeness: are all new endpoints, config keys, and behavioral changes covered?"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/guides/getting-started/configuration.mdx` at line 133, Update
the docs entry for cache.cleanup_interval to state it only applies to the
in-memory cache: explicitly mention that cache.cleanup_interval controls the
cleanup interval for in-memory entries and is ignored when cache.type is set to
"redis" (or any non-in-memory backend); reference the existing config keys
cache.cleanup_interval and cache.type in the text so readers know the limitation
and avoid misconfiguration.

197-197: ⚠️ Potential issue | 🟡 Minor

Replace "expiration" with "TTL" to satisfy style guidelines.

Vale flags "expiration" as too wordy. Although a past review comment marked this as addressed, the word "expiration" remains on line 197.

📝 Suggested fix
-When Redis caching is enabled, Thunder uses Redis native key expiration for TTL handling.
+When Redis caching is enabled, Thunder uses Redis native key TTL handling.

As per coding guidelines, docs/**: "Consistency: does the style match existing documentation?"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/guides/getting-started/configuration.mdx` at line 197, Update
the sentence that currently reads "When Redis caching is enabled, Thunder uses
Redis native key expiration for TTL handling." by replacing the word
"expiration" with "TTL" so it reads "When Redis caching is enabled, Thunder uses
Redis native key TTL for TTL handling." Locate this text in the configuration
guide (the sentence containing "Redis native key expiration") and make the
single-word replacement to conform to the docs style guidelines.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/content/guides/getting-started/configuration.mdx`:
- Line 141: Update the heading text "Per-Cache Overrides With
`cache.properties`" to use title case by changing "With" to lowercase — i.e.,
"Per-Cache Overrides with `cache.properties`" so it matches documentation style
and existing docs casing conventions; locate and edit the heading string in the
docs content where that exact heading appears.
- Line 173: The sentence describing FlowGraphCache is wordy; replace "It is not
a system-level cache used to optimize shared database reads across Thunder
instances. Instead, it caches in-process flow graph objects used during flow
execution, and those entries are stored as Go object structures rather than as
Redis-backed cache data." with a concise alternative that removes "It is"
phrasing—e.g., state that FlowGraphCache is always in-memory and caches
in-process flow graph Go objects (not a system-level or Redis-backed cache) to
match docs style; update the sentence mentioning FlowGraphCache in
configuration.mdx accordingly.

---

Duplicate comments:
In `@docs/content/guides/getting-started/configuration.mdx`:
- Line 133: Update the docs entry for cache.cleanup_interval to state it only
applies to the in-memory cache: explicitly mention that cache.cleanup_interval
controls the cleanup interval for in-memory entries and is ignored when
cache.type is set to "redis" (or any non-in-memory backend); reference the
existing config keys cache.cleanup_interval and cache.type in the text so
readers know the limitation and avoid misconfiguration.
- Line 197: Update the sentence that currently reads "When Redis caching is
enabled, Thunder uses Redis native key expiration for TTL handling." by
replacing the word "expiration" with "TTL" so it reads "When Redis caching is
enabled, Thunder uses Redis native key TTL for TTL handling." Locate this text
in the configuration guide (the sentence containing "Redis native key
expiration") and make the single-word replacement to conform to the docs style
guidelines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 47091ba5-a8c3-4f5b-8d86-d766ff991949

📥 Commits

Reviewing files that changed from the base of the PR and between 7c570f7 and 5da6e44.

📒 Files selected for processing (1)
  • docs/content/guides/getting-started/configuration.mdx

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (2)
docs/content/guides/getting-started/configuration.mdx (2)

141-141: ⚠️ Potential issue | 🟡 Minor

Fix heading casing to satisfy title-case lint.

Line 141 currently fails WSO2-IAM.TitleCaseTitles. Update the heading text to match the project’s title-case rule.

Suggested fix
-### Per-Cache Overrides with `cache.properties`
+### Per-Cache Overrides With `cache.properties`

As per coding guidelines, docs/**: "Consistency: does the style match existing documentation?"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/guides/getting-started/configuration.mdx` at line 141, The
heading "Per-Cache Overrides with `cache.properties`" violates the TitleCase
rule; update this heading in the file to use the project's title-case style
(e.g., "Per-Cache Overrides With `cache.properties`" or whatever exact TitleCase
convention the repo uses) so it satisfies WSO2-IAM.TitleCaseTitles; locate the
heading text "Per-Cache Overrides with `cache.properties`" and edit only the
casing while leaving the inline code token `cache.properties` unchanged.

197-197: ⚠️ Potential issue | 🟡 Minor

Replace “expiration” with “TTL” to pass Vale wording rules.

Line 197 triggers WSO2-IAM.TooWordy; use “TTL” phrasing instead.

Suggested fix
-When Redis caching is enabled, Thunder uses Redis native key expiration for TTL handling.
+When Redis caching is enabled, Thunder uses Redis native key TTL handling.

As per coding guidelines, docs/**: "Consistency: does the style match existing documentation?"

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/guides/getting-started/configuration.mdx` at line 197, Update
the sentence "When Redis caching is enabled, Thunder uses Redis native key
expiration for TTL handling." to replace the word "expiration" with the
abbreviation "TTL" to satisfy Vale rules; e.g., reword it to "When Redis caching
is enabled, Thunder uses Redis native key TTL handling" (or similar phrasing
that uses "TTL" instead of "expiration") so the docs remain consistent with
existing documentation style.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/content/guides/getting-started/configuration.mdx`:
- Line 141: The heading "Per-Cache Overrides with `cache.properties`" violates
the TitleCase rule; update this heading in the file to use the project's
title-case style (e.g., "Per-Cache Overrides With `cache.properties`" or
whatever exact TitleCase convention the repo uses) so it satisfies
WSO2-IAM.TitleCaseTitles; locate the heading text "Per-Cache Overrides with
`cache.properties`" and edit only the casing while leaving the inline code token
`cache.properties` unchanged.
- Line 197: Update the sentence "When Redis caching is enabled, Thunder uses
Redis native key expiration for TTL handling." to replace the word "expiration"
with the abbreviation "TTL" to satisfy Vale rules; e.g., reword it to "When
Redis caching is enabled, Thunder uses Redis native key TTL handling" (or
similar phrasing that uses "TTL" instead of "expiration") so the docs remain
consistent with existing documentation style.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5c77a6e4-cce4-4746-8100-709b80972c83

📥 Commits

Reviewing files that changed from the base of the PR and between 5da6e44 and c2d779e.

📒 Files selected for processing (1)
  • docs/content/guides/getting-started/configuration.mdx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Skip generating changelog for a particular PR Type/Docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant