← Useful
26 September 20266 min read
News

Load the most important things first: A prioritization plan for faster websites

A fast website is not just about fewer kilobytes. With the right loading order, important content becomes visible and usable before the rest of the page has finished loading.

Category: Website performance

A website can be technically optimized and still feel slow. The problem is often not just how much is loaded, but the order in which the browser receives the work. If a large hero image, multiple fonts, analytics tools and extensive JavaScript compete for capacity, users have to wait for the content that actually matters.

A better strategy is to divide the page in two: what must be ready for users to understand and use the page, and what can come later. This prioritization provides a practical basis for improving Core Web Vitals, image usage, caching, code and databases without starting with a random list of technical measures.

Mobiltesting viser hva brukeren faktisk møter først.
Mobile testing shows what the user actually encounters first.

Define what needs to be ready first

Start with the above-the-fold area on mobile. What does a visitor need to understand where they have arrived, what the business offers and what the next step is? On a typical service page, the answer might be:

  • logo and simple navigation
  • heading and short explanation
  • a clear call-to-action button
  • the most important image or illustration

This is the page’s priority content. Cookie tools, chat, carousels, video players, maps, recommendations and content further down the page are normally not as critical. They can be useful, but they should not delay the page’s main purpose.

Prioritization should be done for each page type. A product page needs the product name, price, main image and purchase option early. An article needs a title, introduction and readable text. A contact page needs contact information and a form. One common loading strategy for the entire website rarely works well.

Use Core Web Vitals to assign roles

Core Web Vitals can be used as three different questions about the user experience, not just as a single score.

How quickly does the main content appear?

Largest Contentful Paint measures when the largest visible content element is displayed. On many business websites, this is a hero image or a large block of text. If the element is discovered late, has too large a file size or waits for blocking stylesheets, the opening feels slow.

Lastrekkefølgen bør vurderes for hver viktig sidetype.
The loading order should be assessed for each important page type.

First find out which element is actually being measured. Compressing small icons does little if the main image is still too large or is loaded through a script that the browser discovers late.

Does the page respond when the user does something?

Interaction to Next Paint concerns responsiveness to clicks, taps and keyboard input. Heavy JavaScript execution can make a visible button seem unresponsive even when the page appears finished. Break up extensive processing, remove unused code and avoid starting all tracking and interface functions at the same time.

Does the content stay in place?

Cumulative Layout Shift measures unexpected shifts. Images without reserved space, banners that slide in at the top and fonts that change the text size after loading are common causes. Set dimensions for media and reserve space for elements that appear later.

Give the main image special treatment

Do not treat all images the same way. The main image in the above-the-fold area should be discovered and loaded early. Images further down the page can normally wait until the user approaches them.

A practical image strategy consists of four choices:

Målinger gjør det mulig å finne hva som forsinker siden.
Measurements make it possible to identify what is slowing the page down.
  1. The right crop: Mobile users should not have to load a wide desktop image that is then heavily cropped.
  2. The right dimensions: Deliver a file that roughly fits the space it will fill, preferably with multiple sizes for the browser to choose from.
  3. An efficient format: Use modern image formats when the publishing solution and browser support make this appropriate.
  4. The right timing: Do not use lazy loading for the image that is likely to be the page’s largest visible element.

Also consider whether the image needs to be there at all. A decorative hero image can cost a great deal of loading time without helping the user. Good typography, a precise heading and a calm field of color can create a faster and clearer opening.

Separate critical CSS from the rest

The browser needs CSS to render the page correctly. Large stylesheets with rules for all templates, components and campaigns can therefore delay the first render, even if the current page uses only a small part of them.

First remove style rules that are no longer used. Then divide the code according to need, so that a simple article page does not have to load all the styling for an online store, forms and carousels. The most important styling for the above-the-fold area must be available early, while less important styling can come later.

Be careful with automated tools that move or combine CSS without oversight. They may produce good test results on one page while creating brief flashes of unstyled content or errors on other page types. Test representative templates and different screen widths.

Defer JavaScript that does not support the primary task

JavaScript affects downloading, processing and interaction. Each function should therefore have a clear answer to two questions: Does it need to exist on this page, and does it need to start before the user can do what matters most?

A contact form may need validation when the user starts filling it out. A map module can wait until the map approaches the screen or the user asks to open it. A chat feature can start after the main content is ready. A carousel script should not be loaded on pages without a carousel.

Third-party scripts require particular attention because the business does not fully control their size or execution. Create an overview of analytics, marketing, video, chat, forms and other embeds. Record who owns the requirement, which pages the script is used on, and whether it can be activated later or after consent.

Ensure the server delivers the first response quickly

Good browser prioritization helps less if the server takes a long time to produce the HTML document. This is where caching, application code and the database meet.

Page caching can allow the server to deliver fully generated pages without rebuilding them for every visit. This works well for public content that is the same for most users. Personal pages, shopping carts and logged-in areas need more precise rules so that incorrect content is not cached.

Object caching can reduce repeated database queries, while browser caching means static files do not have to be downloaded again on every page visit. Filenames or versioning must change when content changes, so users do not get stuck with outdated files.

If the database is still the bottleneck, investigate which queries are taking time and why. Common causes include extensive filtering, large tables with accumulated data, missing indexes or extensions that perform the same lookups multiple times. Do not start with general database cleanup without knowing what is actually slowing the pages down.

Make perceived speed an acceptance criterion

A page should not be assessed only by when everything has finished loading. What matters is when it becomes understandable, stable and usable. Therefore, create a simple checklist for each important page type:

  • The heading and main message appear without unnecessary waiting.
  • The most important image appears early and has space reserved for it.
  • The primary button responds immediately when used.
  • The content does not shift when fonts, images or banners load.
  • Features further down the page do not delay the first viewport.
  • Repeat visits benefit from the right caching.

Test on an ordinary mobile phone and a connection that does not hide problems through high capacity. Test both first-time visits without a cache and repeat visits with a cache. A fast office computer on a stable network provides an incomplete picture of the customer experience.

A practical order for the work

Start with one important page type, but consider the entire loading sequence rather than isolated measures. The work can be carried out as follows:

  1. Define what the user must see and be able to do first.
  2. Identify the element that determines Largest Contentful Paint.
  3. Optimize the main image, fonts and critical CSS.
  4. Remove or defer JavaScript that does not support the first task.
  5. Reserve space for media and dynamic components.
  6. Check the server's response time, caching and database activity.
  7. Test the page on mobile and carry out the most important actions.

The goal is not to load as little as possible regardless of circumstances. The goal is for the website to use its capacity at the right time. When the main content and actions get priority, the page becomes faster to understand and use, even before the last file has finished loading.