今日已更新 244 条资讯 | 累计 27419 条内容
关于我们

Building Fast Websites for Pakistan's Real Network Conditions (Not Just a Lighthouse Score)

Muhammad Farzan 2026年08月01日 20:19 1 次阅读 来源:Dev.to

It's easy to test a site on office fibre, get a 95+ Lighthouse score, and call performance "done." Then someone in a secondary city mentions the site feels slow on their phone, and the gap between tested performance and real performance becomes obvious. This isn't a Pakistan-specific problem in theory, but it's an unusually common one in practice — a large share of real users here are on congested 3G or throttled 4G, on mid-range Android devices, often outside the main metros where infrastructure is best. If you're building for a Pakistani (or generally emerging-market) audience, "works great in the office" isn't the same as "works great for the actual user." Here's what actually moves the needle, beyond just plugging in a CDN. A CDN helps, but it doesn't fix the last mile A CDN gets your assets physically closer to the user, which helps. But if the connection between someone's phone and the nearest edge node is still a congested 3G link, the CDN's job is basically done — the bottleneck is the last mile, and no amount of edge-caching fixes that. What actually helps is reducing how much has to travel down that last mile in the first place. That reframes the whole problem: less about "getting bytes there faster" and more about "sending fewer bytes." 1. Image weight is usually the biggest offender Images are typically the single largest contributor to page weight, and the fix isn't exotic: // Next.js example — explicit width/height prevents layout shift, // and the Image component serves modern formats automatically import Image from " next/image " ; < Image src = "/hero.jpg" alt = "Product hero shot" width = { 1200 } height = { 630 } priority // only for above-the-fold images /> A few concrete habits that add up: Serve WebP/AVIF instead of raw JPEG/PNG where you can — usually 25-50% smaller at equivalent visual quality Always set explicit width / height (or use a framework component that does it for you) so the browser doesn't shift layout while images load — this als

本文内容来源于互联网,版权归原作者所有
查看原文