fix: eliminate 2s LCP rendering delay from Directus timeout on Hero
The Hero server component awaited getMessages(locale) which called Directus with a 2-second timeout. On testing.dk0.dev (or when Directus is unreachable), this blocked the entire Hero render for ~2s → LCP 3.0s / 2320ms rendering delay. Changes: - Hero.tsx: remove getMessages() call entirely; use t() for all strings - messages/en.json + de.json: add hero.badge, hero.line1, hero.line2 keys - lib/i18n-loader.ts: invert lookup order — JSON first, Directus only as override for keys absent from JSON. Previously Directus was tried first for every key, causing ~49 parallel network requests per page load in HomePageServer (aboutT + projectsT + contactT + footerT translations). Now all JSON-backed keys return instantly without any network I/O. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,9 @@
|
||||
},
|
||||
"home": {
|
||||
"hero": {
|
||||
"badge": "Student & Self-Hoster",
|
||||
"line1": "Building",
|
||||
"line2": "Stuff.",
|
||||
"features": {
|
||||
"f1": "Next.js & Flutter",
|
||||
"f2": "Docker Swarm & CI/CD",
|
||||
|
||||
Reference in New Issue
Block a user