cashews icon indicating copy to clipboard operation
cashews copied to clipboard

Cache with async power

Results 56 cashews issues
Sort by recently updated
recently updated
newest added

When I add CacheEtagMiddleware middleware into fastapi project cashews creates two records in redis database on GET request: one with key and one with etag. When I try to invalidate...

bug
v8

Comparing functools.cache and cashews in mem cache: - functools takes `500 ns` to return (sync function) - cashews takes `75000 ns` to return (async function) for reference I used that...

cashews version: 7.3.2 redis version: 6.2.0 Error: redis: can not execute command: SET/GET

validation

Fixes #297 ## Fix IndexError in CacheEtagMiddleware The `_is_early_cache()` function in FastAPI middleware would raise an `IndexError` when processing empty lists. This fix adds a length check (`len(data)`) before accessing...

This PR fixes a potential `IndexError` in the `_is_early_cache` function when a FastAPI endpoint returns an empty list. **Issue:** ```python def _is_early_cache(data: Any) -> bool: return isinstance(data, list) and isinstance(data[0],...

The `@noself(cache)()` decorator is a powerful tool for caching class methods. However, when very large values are passed to the cached function, the resulting cache key becomes excessively long. This...

Before that fix, it was not possible to use library when Redis restarts sometimes. Please merge this PR or previous one (#337) and also backport one of them to all...

I have been observing that occasionally some of my cached + locked functions get stuck calling set_lock repeatedly. This leads to millions of redis calls in a ~30 min span...

# Description of the Issue When decoding a streaming response, the presence of colons (:) in the headers causes the process to fail. This results in an error, making it...