10 Commits

Author SHA1 Message Date
Martijn Pieters
d10f4af6d6 Import supported backends
This ensures that any syntax issues are caught early (by type checkers
and tests). Backends that are missing dependencies are skipped. By
importing, this exposed an issue where the redis type annotations
raised an exception, which has been fixed by using forward annotations.

To help avoid import dependency hell, the Backend ABC has been moved to
`fastapi_cache.types`. In the process, it has been made an actual ABC.
2023-05-14 17:02:30 +01:00
Martijn Pieters
23d439f83a Make backends store bytes instead of strings
This is, for the majority of backends, the native format anyway, and so
we save encoding and decoding when using the PickleCodec or if (in future)
a orjson Coder was to be added.

For the JsonCodec, the only thing that changed is the location where the
JSON data is encoded to bytes and decoded back again to a string.
2023-05-10 17:35:15 +01:00
Ivan Moiseev
10f819483c fix: replace pipe for Optional 2022-11-03 15:49:58 +04:00
Ivan Moiseev
4c6abcf786 feat: add more type hints 2022-10-22 20:59:37 +04:00
kailyn
2f1b1409b9 bugfix: '+' is more prior than 'or' 2022-04-24 11:19:20 +08:00
Jimmy
d67797a1d5 Add DynamoDB backend 2021-09-29 16:14:28 +02:00
long2ice
0fd9e53e06 update memory cache 2020-11-10 10:34:52 +08:00
long2ice
80536a1429 fix ci error 2020-11-04 12:58:01 +08:00
long2ice
e483e0dc55 add clear method 2020-11-03 18:08:06 +08:00
long2ice
c0259bc699 Add in-memory support. 2020-10-08 15:10:34 +08:00