recipes: preload hero images with high priority
All checks were successful
CI / update (push) Successful in 3m1s
All checks were successful
CI / update (push) Successful in 3m1s
Add fetchpriority="high" and <link rel="preload"> hints to hero images on both the recipe listing and detail pages. Also prefetch the full-size hero image on card hover via new Image() to warm the cache before navigation.
This commit is contained in:
@@ -338,6 +338,9 @@
|
||||
<svelte:head>
|
||||
<title>{labels.metaTitle}</title>
|
||||
<meta name="description" content="{labels.metaDescription}" />
|
||||
{#if heroRecipe}
|
||||
<link rel="preload" as="image" href="https://bocken.org/static/rezepte/full/{heroImg}" fetchpriority="high" />
|
||||
{/if}
|
||||
<meta property="og:image" content="https://bocken.org/static/rezepte/thumb/ragu_aus_rindsrippen.webp" />
|
||||
<meta property="og:image:secure_url" content="https://bocken.org/static/rezepte/thumb/ragu_aus_rindsrippen.webp" />
|
||||
<meta property="og:image:type" content="image/webp" />
|
||||
@@ -352,6 +355,7 @@
|
||||
src="https://bocken.org/static/rezepte/full/{heroImg}"
|
||||
alt=""
|
||||
loading="eager"
|
||||
fetchpriority="high"
|
||||
data-recipe={heroRecipe.short_name}
|
||||
/>
|
||||
<div class="hero-overlay"></div>
|
||||
|
||||
@@ -300,6 +300,7 @@ h2{
|
||||
<svelte:head>
|
||||
<title>{data.strippedName} - {labels.title}</title>
|
||||
<meta name="description" content="{data.strippedDescription}" />
|
||||
<link rel="preload" as="image" href={hero_img_src} fetchpriority="high" />
|
||||
<meta property="og:image" content="https://bocken.org/static/rezepte/thumb/{img_filename}" />
|
||||
<meta property="og:image:secure_url" content="https://bocken.org/static/rezepte/thumb/{img_filename}" />
|
||||
<meta property="og:image:type" content="image/webp" />
|
||||
|
||||
Reference in New Issue
Block a user