Zum Inhalt springen
Core Web Vitals specialists
Critical CSSWebP & AVIFCode SplittingLayout Shift Fix

Frontend Performance That Convinces Users and Search Engines

Render-blocking resources, uncompressed images and bloated JavaScript cost you visitors and rankings. We optimize your frontend for excellent Core Web Vitals and a noticeably faster user experience.

0.8s

average LCP after optimization (project experience)

50+

optimized frontend projects

92%

less transferred JavaScript bytes (typical)

0.01

average CLS value after optimization

Frontend performance determines how quickly your website becomes visible and interactive for users. While server optimization accelerates raw data delivery, the frontend architecture determines how efficiently the browser converts that data into a usable page. Render-blocking CSS, unoptimized images and monolithic JavaScript bundles are the most common causes of poor Core Web Vitals. We systematically analyze your frontend and implement optimizations that bring Largest Contentful Paint, Interaction to Next Paint and Cumulative Layout Shift to excellent values.

Critical CSS: Instant Rendering of the Visible Area

By default, the browser blocks rendering until all CSS files are fully loaded. With CSS files of 100 to 300 kilobytes, this can cost several hundred milliseconds on mobile connections. Critical CSS extracts the CSS rules needed for the visible area (above-the-fold) and embeds them directly in the HTML. The browser can render the visible content immediately while the remaining CSS files load asynchronously. In our projects, critical CSS typically reduces First Contentful Paint by 300 to 800 milliseconds (project experience).

The challenge lies in correctly identifying critical CSS rules. Automated tools like Penthouse or Critical capture the visible area for different viewport sizes and extract the relevant rules. We integrate critical CSS generation into the build process so that current critical styles are generated with every deployment. For pages with different layouts (homepage, category, product detail), we create separate critical CSS sets to maximize accuracy.

Eliminating Render-Blocking Resources

Beyond CSS, synchronously loaded JavaScript files can also block rendering. Every <script> tag without an async or defer attribute stops the HTML parser until the script is downloaded and executed. With multiple external scripts, blocking time quickly exceeds one second. We analyze every external and internal script and implement the appropriate loading strategy.

Asynchronous CSS Loading

Non-critical CSS is loaded asynchronously via rel="preload" and onload swap. The browser starts the download immediately but does not block rendering. Media attribute swapping ensures stylesheets are only applied once fully loaded.

JavaScript Defer and Async

Scripts that do not require DOM manipulation before page construction receive the defer attribute. Analytics and tracking scripts load via async. Inline scripts for interactive elements are deferred to the DOMContentLoaded event.

Resource Hints

preconnect for CDN and API domains builds connections in advance. preload for critical fonts and above-the-fold images prioritizes their download. prefetch for likely next pages loads resources during idle time.

JavaScript Optimization: Bundling, Tree-Shaking and Code Splitting

JavaScript is often the single largest payload on modern websites. According to HTTP Archive, the average JavaScript payload on mobile devices is 508 kilobytes (HTTP Archive, 2024). Every kilobyte must be downloaded, parsed and compiled before the page becomes interactive. We reduce JavaScript overhead through a combination of intelligent bundling, aggressive tree-shaking and strategic code splitting.

Image Optimization: WebP, AVIF and Responsive Images

Images account for an average of 42 percent of total website weight (HTTP Archive, 2024). Systematic image optimization is therefore the most impactful lever for reducing transferred data. We implement a complete image optimization pipeline combining modern formats, responsive resolutions and intelligent loading.

Modern Image Formats

WebP delivers 25 to 34 percent smaller files than JPEG at comparable quality (Google, 2024). AVIF achieves up to 50 percent savings over JPEG. We serve the best available format for each browser via the <picture> element.

Responsive Images

Through srcset and sizes, each device receives the appropriate image resolution. A smartphone does not load desktop images. We generate 4 to 6 resolution variants per image and configure sizes attributes for the actual layout.

Lazy Loading

Images below the viewport are loaded only when the user scrolls to them. The native loading="lazy" attribute is supplemented by Intersection Observer for more precise control. Above-the-fold images receive fetchpriority="high" instead.

We integrate automatic image conversion into the build process or as server-side on-the-fly conversion. The build approach pre-converts all source images to WebP and AVIF, enabling the fastest delivery. The on-the-fly approach converts images on first request and caches the results, which is particularly suited for CMS-based websites with frequently changing image content.

For Shopware shops with thousands of product images, we implement an automated pipeline that generates images in all required formats and resolutions upon upload. Thumbnail configuration is aligned with actual display sizes in the theme to avoid unnecessary variants and save storage space.

Font Optimization: Subsetting and Loading Strategies

Web fonts are a frequently underestimated performance bottleneck. A single font family with four weights (Regular, Italic, Bold, Bold Italic) can weigh 200 to 400 kilobytes. We optimize font delivery on multiple levels to accelerate visual rendering and minimize Flash of Unstyled Text (FOUT) or Flash of Invisible Text (FOIT).

  • Font Subsetting: Removing unneeded character sets (e.g., Cyrillic, Greek) reduces file size by 50 to 80 percent. For German websites, we retain Latin, Latin Extended and German special characters
  • WOFF2 Format: WOFF2 offers 30 percent better compression than WOFF and is supported by all modern browsers. We serve WOFF2 exclusively with WOFF as a fallback for older clients
  • font-display: swap: The browser immediately shows text in the fallback font while the web font loads. This prevents invisible text (FOIT) and enables instant readability
  • Preload for Critical Fonts: The primary font file is loaded via <link rel="preload"> with high priority. This shortens the time until the font swap and minimizes the visual transition
  • Variable Fonts: Instead of separate files for Regular, Medium and Bold, a variable font delivers all weights in one file. With more than two weights, the total size is less than the sum of individual files
  • Self-Hosting: Fonts are served from your own server or CDN instead of external services. This eliminates an additional DNS lookup and TCP connection setup and provides full control over caching headers

Preload and Prefetch Strategies

Resource hints tell the browser which resources to load or prepare in advance. Used correctly, they can significantly reduce perceived load time by establishing connections and loading resources before they are actually needed. Used incorrectly, they waste bandwidth and slow down critical resources.

Preload: Prioritize Critical Resources

Preload instructs the browser to download a resource with high priority. We use preload specifically for the most important font file, the LCP image and critical-path JavaScript. Too many preload hints compete for bandwidth and counteract the effect.

Prefetch: Preload Next Pages

Prefetch loads resources in the background that the user will likely need next. For e-commerce websites, we prefetch product detail pages from category listings; for content sites, the next article. This reduces perceived load time on page transitions to near zero.

Preconnect: Establish Connections Early

Preconnect completes DNS resolution, TCP handshake and TLS negotiation to a domain in advance. We use preconnect for CDN domains, API endpoints and analytics services to have a ready connection for the first actual request.

Speculation Rules: Instant Navigation

The Speculation Rules API enables the browser to pre-render pages in the background. On click, the page is instantly visible. We configure speculation rules for the most likely navigation paths based on analytics data and user behavior.

CSS Containment and Layout Shift Prevention

Cumulative Layout Shift (CLS) measures unexpected layout shifts during page loading. A CLS value above 0.1 is rated poor by Google and impairs both user experience and ranking. The most common causes are images loading without dimension attributes, dynamically inserted ad banners, asynchronously loaded web fonts and embedded content without reserved space.

  • Explicit Dimensions: Every image and video receives width and height attributes or CSS aspect-ratio so the browser can reserve space before loading
  • Placeholders for Dynamic Content: Ad banners, cookie consent bars and loading widgets receive skeleton placeholders at the exact target size, displayed before the content loads
  • Font Fallback Metrics: Using the CSS property size-adjust, we metrically match the fallback font to the web font. This minimizes layout shift during the font swap to an imperceptible degree
  • CSS Containment: The CSS property contain confines layout calculations to individual containers. Changes within a container do not trigger a reflow of the entire document, improving rendering performance and layout stability
  • Content-Visibility: content-visibility: auto defers rendering of content outside the viewport. The browser calculates layout and paint only when the user scrolls nearby. For long pages with many sections, this can reduce initial render time by 50 percent or more
  • Transform Animations: Animations using transform and opacity instead of top, left or width cause no layout recalculation and are GPU-accelerated

Third-Party Script Management

Third-party scripts for analytics, tracking, chat widgets, social media and advertising often account for 30 to 50 percent of total JavaScript payload (HTTP Archive, 2024). Each external script requires at least one DNS lookup, a TCP connection and a TLS negotiation before it can even be downloaded. We implement systematic third-party management that preserves necessary functionality while minimizing performance impact.

Audit and Prioritization

Inventory of all included third-party scripts with measurement of their individual performance impact. Removal of unused scripts, consolidation of redundant services and prioritization by business value.

Deferred Loading

Non-critical scripts like chat widgets and social media embeds are loaded only after user interaction or after a timeout. This accelerates the initial page load without sacrificing functionality.

Facade Pattern

Heavy embeds (e.g., YouTube videos or maps) are replaced with lightweight placeholders that load the actual widget only on click or hover. A YouTube embed saves 500 to 800 kilobytes on initial load.

Above-the-Fold Optimization: First Impressions Matter

The visible area on initial load (above-the-fold) determines the first impression and perceived speed. Users evaluate website load time primarily by how quickly visible content appears, not by when the page is fully loaded. We optimize the above-the-fold area holistically to push Largest Contentful Paint below 2.5 seconds.

Prioritization begins with identifying the LCP element. In most cases, this is a hero image, a heading or a product image. This element receives the highest loading priority: fetchpriority="high" for images, inline styles for surrounding CSS rules and preload hints for the source file. Simultaneously, we eliminate all resources blocking the visible area: render-blocking CSS is replaced by critical CSS, JavaScript is deferred, and images below the fold receive loading="lazy".

A proven pattern is progressive rendering: the server delivers the HTML head with critical CSS and preload hints immediately (via HTTP/2 Early Hints or chunked transfer), so the browser can begin rendering while the server is still generating the rest of the page. Combined with server-side caching and streaming SSR, this achieves First Contentful Paint values under 500 milliseconds.

CSS Optimization in Detail

Beyond critical CSS, additional CSS optimizations improve rendering performance. CSS is a render-blocking resource, and every reduction in CSS file size and improvement in selector efficiency directly affects load time.

Before and After: Typical Frontend Optimization Results

The following values show typical improvements from our frontend optimization projects. Actual results depend on the initial state and website complexity. Our reference projects document the achieved improvements in detail (project experience).

MetricBefore OptimizationAfter Optimization
Largest Contentful Paint (LCP)3.5 - 8.0 s0.6 - 1.8 s
Interaction to Next Paint (INP)350 - 900 ms50 - 150 ms
Cumulative Layout Shift (CLS)0.15 - 0.450.00 - 0.05
JavaScript payload (initial)800 - 2,500 KB80 - 300 KB
CSS payload (initial)150 - 400 KB8 - 25 KB (critical CSS)
Image weight (typical page)2.0 - 8.0 MB200 - 600 KB
PageSpeed Insights Score (mobile)25 - 5590 - 100

The Frontend Optimization Process

Performance Budgets: Securing Improvements Long-Term

Without performance budgets, regressions gradually creep back in after an optimization. New features bring new JavaScript, additional images and further dependencies. Performance budgets define upper limits for critical metrics and are automatically verified in the build process.

Size Budgets

Maximum values for JavaScript bundle size, CSS file size, image weight per page and total weight. The build fails when a budget is exceeded, forcing a conscious decision.

Timing Budgets

Maximum values for LCP, INP and CLS based on synthetic Lighthouse tests in the CI/CD pipeline. Every pull request is automatically tested against defined budgets.

Rule-Based Budgets

Number of HTTP requests, number of external domains, maximum main thread blocking time. These rules catch common anti-patterns before they reach production.

Optimize Frontend and Server Together

The best frontend optimizations reach their full potential only on a fast server infrastructure. We recommend a combined performance analysis that examines both server and frontend layers together. This identifies the optimal mix of measures for maximum improvement with minimal effort.

Frequently Asked Questions About Frontend Optimization