Hi there,

I've just finished designing a new website -

It looks quite good, but I'm a little concerned with the speed at which the homepage loads.

I've ran Google Page Speed and it suggests Deferring the Parsing of Javascript elements, but I have no idea what that means or how to do it.

How would you go about speeding the site up, especially when viewed on a mobile device?

Many thanks,

HT

Dani AI

Generated

Short, practical primer for : “defer parsing of JavaScript” simply means preventing external scripts from stopping the browser from parsing HTML and doing the first render. Practical options: add defer to external scripts (executes after parsing and preserves order), use async for independent scripts (executes as soon as downloaded, order not guaranteed), or move non‑critical scripts to the end of <body>. Inline only very small critical bits. Example:

<script src="vendor.js" defer></script>
<script src="analytics.js" async></script>
<script src="main.js" defer></script>

Caveat: async can break order for dependent scripts — defer is the safer default for app code. (developer.mozilla.org)

As suggested, server-side compression and caching are high-impact, low-effort wins. Enable gzip or Brotli compression on the server and add long Cache-Control (eg. max-age + immutable) for hashed static assets; this reduces bytes sent to mobile clients immediately. Most common servers (Apache/Nginx/IIS) have simple configs or one-click settings in control panels. (developers.google.com)

As pointed out, images are often the biggest culprit. Resize and compress source images, serve next‑gen formats when possible (WebP/AVIF), and lazy-load below-the-fold images with loading="lazy". Use a proper width/height to avoid layout shifts and consider preloading the single critical hero image only. Example:

<img src="hero.webp" width="1200" height="600" loading="lazy" alt="...">

Reducing image bytes typically gives the biggest visible improvement on mobile. (web.dev)

Quick checklist to act on right now (builds on earlier replies): run Lighthouse or WebPageTest to get the waterfall; add defer/async or move scripts; enable server compression; set cache headers for static assets; optimize and lazy-load images; trim or defer third‑party widgets and limit webfonts or use font-display: swap.

Recommended Answers

All 6 Replies

Member Avatar for Member #949455

How would you go about speeding the site up, especially when viewed on a mobile device?

@hindu times

You need to cache the webpage and compression the files then the website will load things smoothly and quickly

Ok that's great, thanks.

My web host suggests that I don't need to worry about caching or enabling compression on the server unless I'm getting a lot of traffic (which I'm not, yet).

Would you agree with that?

Member Avatar for Member #949455

My web host suggests that I don't need to worry about caching or enabling compression on the server unless I'm getting a lot of traffic (which I'm not, yet).

@hindu times

It's really depend on you, rather you want caching or enabling compression code on your website.

Having caching or enabling compression is an option if you want it.

Hey i recommend you to use http://gtmetrix.com it also provides actionable recommendations to fix issues related to page speed.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.