Skip to content

Feature request: Share cache with requests-cache #157

@franz101

Description

@franz101

Feature description

Use case

Use the same SQLite backend

Workarounds

Have the same key generation

Plan to implement

Maybe

from aiohttp_client_cache import CachedSession, SQLiteBackend
import requests_cache
cache = "drive/MyDrive/xyz.sqlite"
url = 'https://example.com'

requests_cache.install_cache(cache)
requests.get(url)

async def main():
  global url
  async with CachedSession(cache=SQLiteBackend(cache)) as session:  
    r = await session.get(url)
    print(r.from_cache)
await main()

This evaluates to False, but should be True

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions