Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wren-ai-service): Support TTL for query cache #661

Merged
merged 6 commits into from
Sep 11, 2024
Merged

Conversation

paopa
Copy link
Member

@paopa paopa commented Sep 10, 2024

This PR introduces query caching and performance improvements across multiple services and configurations, utilizing the cachetools library.

Changes:

  1. Added new environment variable:
    • QUERY_CACHE_TTL (default: 3600 seconds)

About cachetools

Key features of cachetools used in this PR:

  • TTLCache: A cache with a fixed maximum size and a maximum lifetime for each item.
  • Configurable ttl (time-to-live) parameters for fine-tuning cache behavior.
  • Thread-safe implementations suitable for concurrent applications.

These changes aim to improve caching efficiency and overall performance across various services by implementing time-based caching with configurable time-to-live (TTL) values.

See https://github.com/tkem/cachetools for more details.

@paopa paopa added module/ai-service ai-service related ci/ai-service ai-service related labels Sep 10, 2024
@paopa paopa marked this pull request as ready for review September 11, 2024 05:08
@paopa paopa requested a review from cyyeh September 11, 2024 05:49
Copy link
Member

@cyyeh cyyeh left a comment

Choose a reason for hiding this comment

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

LGTM

@cyyeh cyyeh merged commit 11dd3eb into main Sep 11, 2024
10 checks passed
@cyyeh cyyeh deleted the feat/query-cache-ttl branch September 11, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/ai-service ai-service related module/ai-service ai-service related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants