Content-Block-Bilder als verarbeitete WebP mit srcset ausliefern
Lighthouse (Mobile) auf der Startseite: Score 40, LCP 25 s, 42 MB. Ursache: nb-headless-content-blocks serialisiert Bildfelder (hero_bgimage, intro_image, Karten, Banner) als publicUrl des ORIGINALS - 3,7 und 13,4 MB JPEGs gingen unveraendert an den Browser, waehrend News-/Produktbilder laengst durch den ImageService laufen. - XCLASS Headless\ProcessedFileReferenceToArray (das Paket instanziiert seinen Serializer per makeInstance): publicUrl = WebP max. 1920 px mit Redaktions-Crop, dazu originalUrl/originalSize, srcset 480-1920 (Stufen, die aufs Original zurueckfielen, entfallen), width/height, mimeType, size. SVG/GIF unveraendert (+Metadaten), Videos/PDFs bekommen mimeType/size. Exception-safe: Fallback auf Stock-Payload. - .htaccess: fileadmin/_processed_/* mit Cache-Control max-age=1 Jahr, immutable (Hash im Dateinamen). Effekt Startseite (gleiche Messbedingungen): LCP 25,1 -> 3,8 s, Bilder 18,7 -> 1,1 MB, gesamt 42 -> 22,6 MB; der Rest ist das 20-MB-Testvideo im Hero (redaktionell) und Frontend-Themen (Ticket 0085-BE). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc9b5fce47
commit
be4bb44c40
3 files changed
+126
No files matched your search
@@ -106,6 +106,19 @@
|
||||
|
||||
|
||||
|
||||
### Begin: Immutable processed images (SEO/Lighthouse 2026-11-10) ###
|
||||
|
||||
# Files below fileadmin/_processed_/ carry a content hash in their name and
|
||||
# never change in place - a year of immutable caching is safe and removes the
|
||||
# "uses-long-cache-ttl" findings (mod_expires below sets only one month).
|
||||
<IfModule mod_headers.c>
|
||||
<If "%{REQUEST_URI} =~ m#^/fileadmin/_processed_/#">
|
||||
Header set Cache-Control "max-age=31536000, immutable"
|
||||
</If>
|
||||
</IfModule>
|
||||
|
||||
### End: Immutable processed images ###
|
||||
|
||||
### Begin: Browser caching of resource files ###
|
||||
|
||||
# This affects Frontend and Backend and increases performance.
|
||||
|
||||
Reference in new issue
Block a user