perf: cache public activity aggregates

This commit is contained in:
ik
2026-09-07 18:54:58 +07:00
parent 24ee01b9c3
commit 214b328cd2
10 changed files with 64 additions and 4 deletions
+11
View File
@@ -0,0 +1,11 @@
from app.public_cache import PublicResponseCache
def test_cache_copies_values_and_invalidates() -> None:
cache = PublicResponseCache()
original = [{"score": 10}]
cache.set(("activity",), original)
original[0]["score"] = 99
assert cache.get(("activity",), 20) == [{"score": 10}]
cache.invalidate()
assert cache.get(("activity",), 20) is None