aiohttp-client-cache icon indicating copy to clipboard operation
aiohttp-client-cache copied to clipboard

Add response filtering options

Open JWCook opened this issue 2 years ago • 0 comments

  • Add a filter() method to get only a subset of cached responses, similar to requests-cache's filter()
  • To start, filtering out expired responses would be the most useful option
  • Other options (like older_than) could be added if/when needed
  • Support the same option(s) for get_urls()

Example usage:

async for response in session.cache.filter(expired=False):
    print(response)

urls = [url async for url in session.cache.get_urls(expired=False)]

JWCook avatar Jul 24 '23 19:07 JWCook