Skip to content

Add Valkey caching for EnginX journal lookup#516

Open
Dagonite wants to merge 1 commit into
mainfrom
valkey-caching
Open

Add Valkey caching for EnginX journal lookup#516
Dagonite wants to merge 1 commit into
mainfrom
valkey-caching

Conversation

@Dagonite

@Dagonite Dagonite commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Closes #509.

Description

  • Add a small Valkey cache helper for JSON get/set operations.
  • Cache the EnginX journal run-to-cycle map in Valkey, while keeping the existing in-process lru_cache.
  • Fall back to reading journal XML files if Valkey is unavailable or misses.
  • Avoid caching an empty map when the journal directory is unavailable.
  • Add tests for the cache helper and EnginX cache hit/miss behavior.

Testing

Install/update local deps

.\.venv\Scripts\python.exe -m pip install -e ".[test]"`

Run Valkey locally

docker run --rm -p 6379:6379 valkey/valkey:latest
$env:VALKEY_URL = "redis://localhost:6379/0"
$env:ENGINX_MAP_CACHE_TTL_SECONDS = "86400"

@Dagonite Dagonite mentioned this pull request May 21, 2026
@Dagonite Dagonite requested a review from keiranjprice101 May 21, 2026 09:46
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.

Cache journal files

1 participant