From f0e68cb31e0cbeb145026b004b83da8b4d811271 Mon Sep 17 00:00:00 2001 From: retoor Date: Thu, 2 Oct 2025 16:28:38 +0200 Subject: [PATCH] Update. --- src/snek/view/avatar.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/snek/view/avatar.py b/src/snek/view/avatar.py index c984ec1..1a9c2d9 100644 --- a/src/snek/view/avatar.py +++ b/src/snek/view/avatar.py @@ -71,7 +71,10 @@ class AvatarView(BaseView): uid = self.request.match_info.get("uid") if uid == "unique": uid = str(uuid.uuid4()) - avatar = multiavatar.multiavatar(uid, True, None) + avatar = await self.app.get(uid) + if not avatar: + avatar = multiavatar.multiavatar(uid, True, None) + await self.app.set(uid, avatar) response = web.Response(text=avatar, content_type="image/svg+xml") response.headers["Cache-Control"] = f"public, max-age={1337*42}" return response