Sub topic 14
Keeping the Page and Downloads Fast
Assume you know basic HTML, URLs, file hosting, and the role of a press release. This chapter focuses on the performance of a newsroom page and its downloadable assets.
Performance means how quickly a page becomes usable and how quickly a visitor can download an asset. A newsroom often contains large photos, logos, press-release PDFs, and video. These files can make the page slow even when the page itself has little text.
Use a simple performance model
A visitor waits for several kinds of work:
- The browser requests the page.
- The server sends HTML, stylesheets, and scripts.
- The browser downloads images and other visible assets.
- The browser displays the page.
- The visitor starts a separate download, such as a high-resolution photograph.
The most important variable is usually transfer size. A 12 MB photograph takes longer to download than a 300 KB version, especially on a mobile connection. Server distance, connection quality, server response time, and browser caching also affect the result.
| Asset | Visitor-facing version | Source or archive version |
|---|---|---|
| Logo | SVG or 20–80 KB PNG | Editable vector file |
| Newsroom image | 200–500 KB WebP or AVIF | Full-resolution JPEG |
| Press-release PDF | Optimized PDF | Print-quality source |
| Video | Poster image or short preview | Hosted video file |
Optimize images without removing useful detail
Create separate versions for separate jobs. A small image displayed in a release does not need the same dimensions as a photograph that journalists may download.
Use modern formats such as WebP or AVIF when your delivery system supports them. Keep a suitable fallback when compatibility matters. Resize an image before compression. Compressing a 6000-pixel image without resizing it still leaves unnecessary pixels.
For downloadable assets, show the file size and dimensions. A journalist should know whether a file is suitable for a web article, print publication, or social post.
# Inspect response size and timing for a newsroom page.
curl -sS -o /dev/null \
-w 'status=%{http_code}\nbytes=%{size_download}\ntime=%{time_total}s\n' \
https://example.com/newsroom
# List asset sizes so unusually large files are easy to find.
find public/newsroom-assets -type f -printf '%s bytes %p\n' | sort -nControl downloads and caching
Serve static assets through a content delivery network (CDN), which is a distributed service that stores copies near visitors. Configure long-lived caching for files whose URLs change whenever their contents change. For example, use a filename such as widget-2-photo-v3.webp instead of replacing a file at the same URL.
Do not cache an embargoed release as a public page before its publication time. Check both the page cache and the cache used by the CDN.
Avoid loading every asset immediately. Load only the images visible on the initial page, and link to the remaining high-resolution files. A download link should not cause the browser to fetch the file before the visitor chooses it.
Follow the request path
Measure the page with browser developer tools or a performance audit. Check total transferred bytes, largest assets, server response time, and whether images load before they are needed. Test on a mobile connection and in a private window, because a warm cache can hide problems.
Common errors include uploading print-resolution images as page thumbnails, using filenames that never change after replacement, preloading every image, and linking to files whose names or sizes do not explain their purpose.
Exercise
A newsroom page loads a 9 MB hero image, although the displayed image is only 800 pixels wide. What should you do first?
Show answer
Create an appropriately sized, compressed preview for the page and keep the 9 MB file only as an optional download if journalists need that resolution.