Add performance optimizations and component refactors
CI / check (push) Successful in 34s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m23s

- Cache read-heavy public API routes via redisCache (leaderboard, values,
  shop, articles, photos, guilds, teams, staff, users, home, radio, badges)
- Add single-flight and bounded-memory cache layer with unit tests
- Parallelize independent DB queries on search, rares, shop, staff, polls
  and profile pages
- Push radio points leaderboard aggregation to SQL with a LIMIT
- Split studio-client and import-furni-client into focused modules
- Clean up next.config.ts
This commit is contained in:
openhands committed 2026-08-17 22:02:21 +02:00
1 parent 54f2bc5e0c
commit f285a7cd98
42 files changed
+1616 -1205

No files matched your search

+14 -11
View File
@@ -9,6 +9,7 @@ import {
} from "@/components/public/ui";
import { CurrencyIcon } from "@/components/shared/currency-icon";
import { UserAvatarThumbnail } from "@/components/shared/user-avatar-thumbnail";
import { cached } from "@/lib/cache";
import { db, User } from "@/lib/db";
export const metadata = { title: "Rankings" };
@@ -25,17 +26,19 @@ export default async function RankingsPage() {
const t = await getTranslations("pages.rankings");
let users: TopUser[] = [];
try {
users = await db
.select({
username: User.username,
look: User.look,
credits: User.credits,
rank: User.rank,
online: User.online,
})
.from(User)
.orderBy(desc(User.credits))
.limit(12);
users = await cached("rankings:top", 60_000, async () =>
db
.select({
username: User.username,
look: User.look,
credits: User.credits,
rank: User.rank,
online: User.online,
})
.from(User)
.orderBy(desc(User.credits))
.limit(12),
);
} catch {
users = [];
}