JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Follow publication

Faster Web Apps: How to Turbocharge Initial Load Speeds

Deep Singh
JavaScript in Plain English
4 min readOct 13, 2022

1. Using async and defer

Normal (Synchronous) Execution
<script async src="script1.js"></script>
<script
defer src="script2.js"></script>

2. Pre-fetch techniques

<link rel='preconnect' href='https://*****.com'>
<link rel='prefetch' href='https://****/images/logo.png'>

3 . Implementing CDN (Content Delivery Network)

4. Code Cleanup and following best practices

import _ from 'lodash'
;import * as utils from "../../utils/utils";
// can be effectively written asimport {isEmpty, pickBy} from 'lodash';
import {util1, util2} from "../../utils/utils";

Lazy Loading for overall performance

<img src="image.jpg" alt="..." loading="lazy" />
<iframe src="video-player.html" title=".. ." loading="lazy"></iframe>

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Written by Deep Singh

Hello! I love to build softwares. Welcome to my page.

Responses (1)

Write a response

Thank you for that tips I didn't know that I can insert async or defer inside a script!

--