Skip to content

feat: add TTL support to CacheChecker - #12979

Open
ArjunR00T wants to merge 1 commit into
deepset-ai:mainfrom
ArjunR00T:feat/cache-checker-ttl
Open

ArjunR00T wants to merge 1 commit into
deepset-ai:mainfrom
ArjunR00T:feat/cache-checker-ttl

Conversation

@ArjunR00T

Copy link
Copy Markdown

Related Issues

Proposed Changes

  • Added optional ttl support to CacheChecker for cache expiration.
  • Added configurable time_field, defaulting to cached_at, for determining the cache timestamp.
  • Expired or timestamp-missing documents are treated as cache misses when TTL is enabled.
  • Preserved existing behavior when ttl=None.
  • Added support and tests for both synchronous and asynchronous execution.
  • Added documentation and a release note.

How did you test it?

  • Added unit tests covering:
    • Fresh cached documents
    • Expired cached documents
    • Documents missing the timestamp field
    • Custom timestamp fields
    • Sync and async execution
    • Serialization/deserialization with TTL configuration
  • Ran CacheChecker unit tests successfully:
    hatch run test:unit test/components/caching/
  • Ran type checks successfully:
    hatch run test:types
  • Ran pre-commit hooks and fixed the reported line-ending issue.
  • Ran the full test suite. One unrelated test failed:
    test/dataclasses/test_byte_stream.py::test_from_file_path_guess_mime_type[spam.csv-expected_mime_types10]
    because application/vnd.ms-excel was detected instead of the expected text/csv.

Notes for the reviewer

The TTL check only applies when ttl is configured. When ttl=None, the existing cache-hit behavior is preserved.

When TTL is configured, documents without the configured timestamp metadata field or with an expired timestamp are treated as cache misses.

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: feat: add TTL support to CacheChecker.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@ArjunR00T
ArjunR00T requested a review from a team as a code owner September 27, 2026 06:36
@ArjunR00T
ArjunR00T requested review from sjrl and removed request for a team September 27, 2026 06:36
@vercel

vercel Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

@ArjunR00T is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Sep 27, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add TTL / expiration support to CacheChecker

2 participants