perf: Base64-Logo -> URL + preconnect gstatic + lazy loading

- Logo: Base64 (82KB) -> /static/logo.png mit Browser-Cache
- Google Fonts: preconnect fonts.gstatic.com hinzugefügt
- Media-Bilder: loading=lazy auf Detailseite
- Betrifft: public_detail, index, admin, test-Seite
- Detailseite: 86KB -> 4.2KB (-95%)
This commit is contained in:
Hermes Agent
2026-06-17 21:21:10 +02:00
parent a4a40fd2e7
commit e2b0bbef1e
2 changed files with 6 additions and 5 deletions
+6 -5
View File
@@ -955,7 +955,7 @@ function toggleTheme(){{document.body.classList.toggle('light');localStorage.set
<body>
<header class="admin-header">
<div class="admin-header-inner">
<img src="data:image/png;base64,{LOGO_B64}" alt="Brettspiel News" style="height:34px;width:auto;">
<img src="/static/logo.png" alt="Brettspiel News" style="height:34px;width:auto;">
<div class="meta">
<span class="count-badge">{len(rows)} Submissions</span>
<a href="/admin" class="admin-btn{' active' if not status_filter else ''}">📋 Alle</a>
@@ -994,7 +994,7 @@ def test_page():
a { color:#4ecdc4; }
</style></head>
<body>
<img src="data:image/png;base64,{LOGO_B64}" alt="Brettspiel News" style="height:34px;width:auto;margin-bottom:1.5rem;display:block;"><h1>🧪 Simulierter WhatsApp Test</h1>
<img src="/static/logo.png" alt="Brettspiel News" style="height:34px;width:auto;margin-bottom:1.5rem;display:block;"><h1>🧪 Simulierter WhatsApp Test</h1>
<p>Dieser curl-Befehl sendet eine Fake-WhatsApp-Nachricht an den lokalen Webhook:</p>
<pre>curl -X POST http://127.0.0.1:5002/whatsapp/webhook \\
-H "Content-Type: application/json" \\
@@ -2016,7 +2016,7 @@ def public_frontend():
<body>
<header class="site-header">
<a href="/" class="site-logo">
<img src="data:image/png;base64,{LOGO_B64}" alt="Brettspiel News" style="height:38px;width:auto;display:block;">
<img src="/static/logo.png" alt="Brettspiel News" style="height:38px;width:auto;display:block;">
</a>
<div class="header-right">
<a href="https://brettspiel-news.de">brettspiel-news.de</a>
@@ -2721,7 +2721,7 @@ def public_detail(sub_id: int):
basename = os.path.basename(path)
src = f"/media/{basename}"
if mime.startswith("image/"):
media_html += f'<img src="{src}" alt="Bild" style="width:100%;height:auto;border-radius:12px;margin:0.5rem 0;">'
media_html += f'<img src="{src}" alt="Bild" loading="lazy" style="width:100%;height:auto;border-radius:12px;margin:0.5rem 0;">'
elif mime.startswith("video/"):
thumb = generate_video_thumbnail(path)
poster = f' poster="/media/{os.path.basename(thumb)}"' if thumb else ""
@@ -2761,6 +2761,7 @@ def public_detail(sub_id: int):
<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Beitrag — BSN Community</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700;14..32,800&display=swap" rel="stylesheet">
<style>
* {{ margin:0; padding:0; box-sizing:border-box; }}
@@ -2792,7 +2793,7 @@ def public_detail(sub_id: int):
<body>
<header class="site-header">
<a href="/" class="site-logo">
<img src="data:image/png;base64,{LOGO_B64}" alt="Brettspiel News" style="height:30px;width:auto;display:block;">
<img src="/static/logo.png" alt="Brettspiel News" style="height:30px;width:auto;display:block;" width="160" height="30">
</a>
</header>
<main class="detail-container">
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB