In this article

Start with the experience worth preserving

The PROFAS website explains a visual examination platform through actual workspace captures. Readers need to see enough detail to understand the product, then enlarge an image when they want to inspect it. Colour, typography, framing and subtle interaction had already been approved. Performance work needed to preserve those choices.

That established a useful constraint. Reducing image detail everywhere would weaken the explanation. Removing interaction would change the experience. Instead, we examined which assets a page needed initially, how large a displayed image actually was and which work could wait until the visitor requested it.

The resulting changes stayed within the public website. The examination application, its backend and the private business workspace were outside the task. The site continued to use its own static content and approved captures. It acquired no runtime connection to examination data or additional analytics service.

Send an image appropriate to its use

A native workspace screenshot is useful for inspection but often excessive for a small card or a narrow mobile viewport. The website now prepares proportional variants at selected widths, including the source’s native width. Each image supplies responsive candidates, a layout-specific size hint and intrinsic dimensions, allowing the browser to choose for the displayed space and pixel density.

The preparation step verifies approved source identities and retains their framing. Resized derivatives use lossless WebP encoding after resizing; the native delivery version preserves the decoded source pixels. An already smaller original can remain in its existing encoding. No crop is introduced to make the asset easier to deliver.

A small embedded preview appears while the selected image loads. It needs no separate request or component loading state. Leading images retain eager priority, while other images can load lazily. Enlarging a product image fetches the unchanged original; the gallery keeps its current view until a replacement has decoded. This gives initial presentation and detailed inspection distinct delivery paths.

The page view uses a responsive derivative. Enlarging the capture opens its unchanged original, preserving detail for inspection.

Load the page the visitor selected

The first JavaScript entry file is only part of a page’s cost. Its dependencies may pull in complete articles, specialist demonstration controls or styles that the visitor has not requested. PROFAS separates lightweight article metadata from article bodies and loads the selected page and body through dynamic imports.

The static build still renders substantive HTML for every public route. It follows the selected route’s manifest dependencies to supply its styles and module preloads, together with one exact preload for the existing Inter font. Article and study styles travel with their pages. A reader arriving directly at an article therefore receives that article’s required assets before client hydration.

Navigation also has a correctness responsibility. The destination loads before the current page is replaced, and a generation check prevents an earlier slow request overriding a later selection. Successful route loads are reused; failed promises are evicted so a subsequent attempt can proceed. Loading strategy and continuity of interaction meet in the same small controller.

Predict sparingly and hint specifically

Prefetching can make a likely destination ready sooner, but it also performs work the visitor may never use. The site waits for 120 milliseconds of pointer or keyboard-focus intent before warming a known local route. It allows two distinct background targets per current page and one active warm-up at a time. The shared route loader deduplicates those imports.

That policy excludes touch pointer entry, external and unknown routes, the current route, downloads and alternative targets. It respects reported data-saving preferences and slower connection types. It warms route code, leaving images and documents alone. Those limits make the speculative work explicit rather than letting every visible link compete with the selected page.

The build also supplies route-specific stylesheet and font Link headers, with Cloudflare Early Hints enabled for the website. The hints identify required assets already known to the static build. They complement the final document’s loading instructions; an informational 103 response is opportunistic and cannot be assumed for every visit.

ENGINEERING NOTE

Give each resource a reason to arrive

  1. Initial document

    Substantive selected-page HTML, required styles, route dependencies and the existing font.

  2. Displayed images

    A layout-appropriate candidate with an embedded preview; deferred images retain lazy loading.

  3. Likely next route

    A bounded code warm-up after deliberate link intent and connection checks.

  4. Detailed inspection

    The unchanged original capture, requested when the reader opens the gallery.

These are separate delivery decisions. Warming a route does not require fetching its original product captures.

Measure the complete initial dependency set

The retained 15 November build comparison counted all initial homepage JavaScript dependencies, using identical local gzip settings for the previous and prepared builds. That total fell from 171,487 to 131,114 bytes, a 23.5% reduction. Initial compressed CSS fell from 25,774 to 20,056 bytes. The existing font remained unchanged.

Those figures describe a specific payload comparison. They are not visitor timings or Core Web Vitals measurements, and later content may change the current totals. Subsequent pages fetch their own required modules; speculative warming is additional intentional work. Keeping the denominator and scope visible makes the comparison useful.

Focused output checks covered static content, route assets, responsive candidates and original image identity. Local interaction review covered navigation, article reading and gallery inspection against the asset runtime used for deployment. The useful result was a delivery path that did less unnecessary work while retaining the website’s visual purpose. That is a concrete engineering outcome a reader can apply to another image-heavy site.