fix(imaging): make avatar and badge images resilient to upstream outages
- Add persistent disk cache for rendered avatars/badges (storage/imaging) so repeats never touch the flaky local renderer and cached renders survive upstream downtime - Serve cache-first with stale-on-error; cut primary/fallback timeouts from 10s/6s to 4s/4s so failing images cannot stall pages - Avatar proxy now returns a graceful 200 silhouette instead of 502 when no renderer can produce a figure, so no broken-image glyphs appear - Badge endpoint becomes a caching proxy trying configured CDN, public Habbo CDN and local /swf copy in order, and drops the fragile IP rate limit that could blank badge streams - Route all site badge images (profile, me, badges, apply pages) through the cached proxy instead of hot-linking images.habbo.com
This commit is contained in:
1 parent
c3ff497050
commit
8a66db4ed7
12 files changed
+458
-58
No files matched your search
@@ -10,7 +10,7 @@ import { ProfileImage } from "@/components/shared/profile-image";
|
||||
import { UserAvatarThumbnail } from "@/components/shared/user-avatar-thumbnail";
|
||||
import { SurfaceCard } from "@/components/surface-card";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { avatarImageUrl, slugify } from "@/lib/format";
|
||||
import { avatarImageUrl, badgeImageUrl, slugify } from "@/lib/format";
|
||||
import { withPublicPagePerformance } from "@/lib/public-page-performance";
|
||||
import { loadDailyRewardState } from "@/lib/services/daily-rewards";
|
||||
import { loadUserDashboard } from "@/lib/services/user-dashboard";
|
||||
@@ -456,7 +456,7 @@ async function MePage({
|
||||
{badges.map((badge) => (
|
||||
<img
|
||||
key={badge.badgeCode}
|
||||
src={`https://images.habbo.com/c_images/album1584/${encodeURIComponent(badge.badgeCode)}.gif`}
|
||||
src={badgeImageUrl(badge.badgeCode)}
|
||||
alt={badge.badgeCode}
|
||||
title={badge.badgeCode}
|
||||
width={40}
|
||||
|
||||
Reference in new issue
Block a user