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

[feature request] return cache_metadata when creating the cache #304

Open
nschloe opened this issue Jan 17, 2025 · 0 comments · May be fixed by #305
Open

[feature request] return cache_metadata when creating the cache #304

nschloe opened this issue Jan 17, 2025 · 0 comments · May be fixed by #305

Comments

@nschloe
Copy link

nschloe commented Jan 17, 2025

When creating a cache, one get the following info in the .extensions:

{
  'http_version': b'HTTP/1.1',
  'reason_phrase': b'OK',
  'network_stream': <httpcore._backends.sync.SyncStream object at 0x774d40e00050>,
  'from_cache': False,
  'revalidated': False
}

When fetching from cache, one gets

{
  'http_version': b'HTTP/1.1',
  'reason_phrase': b'OK',
  'from_cache': True,
  'cache_metadata': {
    'cache_key': '2b0e0bfa0bf634fbd3b40cad50e7e705',
    'created_at': datetime.datetime(2025, 1, 17, 14, 31, 18),
    'number_of_uses': 1
  },
 'revalidated': False
}

I need cache_metadata straight after creating the cache.

@nschloe nschloe linked a pull request Jan 17, 2025 that will close this issue
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 a pull request may close this issue.

1 participant