Skip to content

A4 · Website Performance

Spec reference: Learning Aim A - Principles of Website Development Key idea: Many factors affect how fast and reliably a website loads - some on the server, some on the user's device.


How to improve website performance


Client-side vs server-side factors

Performance issues come from two places: the server (where the website is hosted) and the client (the user's device and connection).

Client-side factors

These depend on the user's hardware and connection:

FactorHow it affects performance
Download speed / bandwidthSlower internet = longer loading times
NIC (Network Interface Card) speedLimits how fast data can be received
Router speedBottleneck between device and internet connection
ISP (Internet Service Provider)Determines maximum bandwidth available
BrowserDifferent browsers parse HTML/CSS/JS differently - some faster than others
Available RAMLow RAM causes the browser to slow down when running complex pages
Processor speedAffects how fast JavaScript and CSS animations are processed
Browser cacheCached resources load instantly - first visit slower, repeat visits faster

INFO

Client-side performance is outside the developer's control - you cannot force users to upgrade their hardware. This is why optimising your code and assets is so important.

Server-side factors

These depend on the web server hosting the website:

FactorHow it affects performance
Upload/download speed of serverDetermines how fast it can send files to users
Number of HTTP requestsEach file (image, CSS, JS) requires a separate request - more requests = slower
File types and sizesLarge uncompressed images and videos slow loading significantly
Server processing powerAffects how quickly server-side scripts (PHP, Python) generate pages
CDN (Content Delivery Network)Distributes content across global servers - users load from nearest server

Where scripts run

A key concept is whether code runs on the client (in the user's browser) or the server.

Client-sideServer-side
LanguageHTML, CSS, JavaScriptPHP, Python, Node.js, Ruby
Runs onUser's browser/deviceWeb server
ExampleForm validation, dropdown menus, animationsDatabase queries, login authentication, generating dynamic pages
Performance impactUses user's CPU and RAMUses server resources - not affected by user's device
PrivacyCode is visible to users (View Source)Code hidden from users

Client-side scripts can personalise experiences and offload work from the server - but they rely on the user's device being capable enough to run them.


Browser compatibility

Different browsers (Chrome, Firefox, Safari, Edge) interpret HTML and CSS slightly differently. A page that looks perfect in Chrome may break in Safari.

W3C standards define how HTML and CSS should be interpreted. Writing valid, standards-compliant code improves cross-browser compatibility.

How to check

  • W3C Validator (validator.w3.org) - checks your HTML and CSS for errors
  • BrowserStack - test your site in multiple browsers simultaneously
  • Chrome DevTools (F12) - inspect and debug rendering issues

TIP

Always test your website in at least three browsers: Chrome, Firefox and Safari (or Edge). Mobile testing is also essential.


Responsiveness

A responsive website adapts its layout to the screen size of the device viewing it. This is achieved using CSS media queries.

css
/* Default styles  -  mobile first */
.container {
  width: 100%;
  padding: 10px;
}

/* Tablet and above */
@media (min-width: 768px) {
  .container {
    width: 750px;
    margin: 0 auto;
  }
}

/* Desktop */
@media (min-width: 1200px) {
  .container {
    width: 1140px;
  }
}

Google uses mobile-first indexing - it ranks the mobile version of your site, not the desktop version. A non-responsive site will rank poorly.


Optimising performance

Key techniques to improve loading speed:

TechniqueEffect
Compress imagesUse WebP format - much smaller than JPG/PNG
Minify CSS/JSRemove whitespace and comments from code files
Reduce HTTP requestsCombine CSS files, use CSS sprites for icons
Enable browser cachingReturning visitors load from cache, not server
Use a CDNServe files from a server closer to the user
Lazy loadingImages only load when they're about to appear on screen
Async/defer scriptsLoad JavaScript without blocking page rendering

Measuring performance - Google Lighthouse

Run Lighthouse from Chrome DevTools (F12 → Lighthouse tab):

Score categoryWhat it checks
PerformanceLoading speed, Time to Interactive, Cumulative Layout Shift
AccessibilityAlt text, colour contrast, keyboard navigation
Best PracticesHTTPS, no console errors, modern APIs
SEOMeta tags, mobile-friendly, crawlable links

Scores are out of 100. Green (90-100), Orange (50-89), Red (0-49).

Your teacher has included BBC News and Sky News Lighthouse reports in your course materials - these are real examples of how professional sites score.


Summary

TermMeaning
Client-sideCode/processing that runs on the user's device
Server-sideCode/processing that runs on the web server
HTTP requestA request the browser makes to the server for each file
CDNContent Delivery Network - servers distributed globally to serve files faster
Responsive designLayout that adapts to different screen sizes
Media queryCSS rule that applies styles based on screen size
W3CWorld Wide Web Consortium - the body that sets web standards
LighthouseGoogle tool that audits website performance, accessibility, SEO


Test Yourself

Question 1 of 5

A user with a slow internet connection reports that a website loads slowly. This is an example of which type of performance factor?

Ad

PassMaven - revision made simple.