How to code faster, lighter JavaScript

Building interactive websites can involve sending JavaScript to your users. Often, too much of it. Have you been on a web page on your phone that looked like it had loaded, only to have nothing happen when you tapped a link or tried to scroll? We all have. 

Byte-for-byte, JavaScript is still the most expensive resource we send to mobile phones because it can delay interactivity in significant ways. In this feature we'll cover some strategies for delivering JavaScript efficiently to your users on mobile, while still giving them a valuable experience. On this page, we'll dig into exactly what's causing the problem. Jump to page 2 for some advice on exactly how to reduce your JavaScript load times, including some web design tools to help you monitor your sites effectively (decent web hosting will help with this, too). Want to simplify things? Try a brilliant website builder, or see our selection of CSS and JavaScript tutorials.

Thank you for reading 5 articles this month* Join now for unlimited access

Enjoy your first month for just £1 / $1 / €1

*Read 5 free articles per month without a subscription

Join now for unlimited access

Try first month for just £1 / $1 / €1

Addy is an engineering manager with the Chrome team at Google. His day-to-day job is leading a speed team who are dedicated to making the web fast. Their projects include Lighthouse.
Read more
A black Dell Latitude 9440 2-in-1 laptop
How to make a laptop faster
little marbles in marble run
Why simplicity matters in UX and digital design
A desktop with a colourful portfolio on screen
How to create an online portfolio: Steps to curating your own corner of the web
No code game engines; a cartoon flea, cartoon people and cartoon rally car
The best no code game engines recommended by leading indie devs
hero
I tested an excellent online Photoshop alternative you've probably never heard of
Photograph of laptop with Shopify sticker, on table beside coffee mug, with woman on her phone out of focus in background
How to use Shopify: tips for beginners
Latest in Javascript
Speed up JavaScript
21 steps to super speedy JavaScript
Angular 8
What's inside Angular 8?
brain.js neural network
Use brain.js to build a neural network
Explore data visualisation with p5.js
Explore data visualisation with p5.js
WebGL 3D
Create a WebGL 3D landing page
JavaScript code splitting
All you need to know about JavaScript code splitting
Latest in Advice
Pietro Chiovaro Blender T-shirt tutorial
How to make a T-shirt in Blender
Paul Hatton KeyShot tutorial
Follow my KeyShot and Photoshop advice for perfect renders every time
Mike Griggs 3D teamwork tutorial
4 tips to make your collaborative art projects run smoothly
Glen Southern Nomad Sculpt tutorial
Learn this clever hack to create CG smoke and fog effects on an iPad
Artist sketchbook tips; a man sits on a stool in a street painting into a sketchbook
Sketchbook watercolour tips from illustrator Jason Chan P.L.
Photograph of a man moving a pile of independent magazines around a warmly lit shop.
10 brilliant indie magazines, as picked by the experts