TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How I test site speed changes using Chrome's local overrides (2021)

58 pointsby illdavealmost 2 years ago

8 comments

mcdonjealmost 2 years ago
&gt;It works by saving a copy of the page you&#x27;re working on (or any other resource, like a JavaScript or CSS file), letting you edit that, and then serving that file instead of the live version.<p>1. You can already set up a local host on your machine to run tests. I thought that was standard practice.<p>2. I&#x27;m glad browsers are offering a similar solution which is easier to set up and useful for front end work. I just checked to see if Firefox has similar functionality, and it seems they support diffs for CSS only, but there is an add-on called Resource Override that appears to have similar functionality.
评论 #36902741 未加载
mostlystaticalmost 2 years ago
Local overrides are super useful for testing site speed:<p>• Your local setup is likely different from production (not serving from production domains, not using image resize services, using different HTTP compression...)<p>• You might not be able to run tests on localhost, e.g. if you&#x27;re an external consultant or working in technical SEO (who often want to give specific recommendations to devs as dev attention is scarce and expensive)<p>There are still some limitations of testing changes in DevTools:<p>• Testing a fresh load is a pain (need to clear OS-level DNS cache, need to clear the connection cache in Chrome, need to clear cookies&#x2F;service worker)<p>• DevTools throttling doesn&#x27;t represent server connections accurately (you need to throttle at the OS level for accurate data, which slows down your whole computer and requires admin rights)<p>WebPageTest [1] and my own tool DebugBear [2] now support experiments to make it easy to try out content changes in a controlled lab environment.<p>[1] <a href="https:&#x2F;&#x2F;product.webpagetest.org&#x2F;experiments" rel="nofollow noreferrer">https:&#x2F;&#x2F;product.webpagetest.org&#x2F;experiments</a> [2] <a href="https:&#x2F;&#x2F;www.debugbear.com&#x2F;docs&#x2F;experiments" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.debugbear.com&#x2F;docs&#x2F;experiments</a>
raman162almost 2 years ago
I love using chrome overrides to test if a front-end bug is fixed on production data! The feedback is immediate and I feel more confident with a PR.<p>It works well for me since I&#x27;m not allowed to export the production data onto my machine or testing environments for HIPPA reasons.<p>This is way better than reviewing an exception from obfuscated javascript (without sourcemaps) and trying to figure out where it occurred.
horsawlarwayalmost 2 years ago
Ok - I think this article pitches the wrong thing (or at least buries the lede).<p>I think the key point is that by using overrides, he can basically implement a deployed change that uses production data, but without having any access or control over production infrastructure, and with no risk for other users.<p>Lots of folks have correctly pointed out that running locally is essentially a solved problem. He can do it against prod data, because he&#x27;s overriding the prod configuration.<p>I&#x27;ve done exactly this for non-browser (and some browser) applications before (using local MITM proxies) but it&#x27;s nifty that chrome lets you skip the certificate headaches and just loads a resource from disk.
评论 #36898865 未加载
andromatonalmost 2 years ago
The snippet for fetching performance numbers is useful but it&#x27;s cargo culting (ie, using incorrectly and needlessly) Number.EPSILON [1], besides not using the built in toFixed(2)<p>How universal is the drive to try to keep others from making needless mistakes?<p>[1] &quot;FCP is &quot; +Math.round((fcp + Number.EPSILON) * 100) &#x2F; 100
lofaszvanittalmost 2 years ago
After wading through the mumbojumbo like lcp, fid, cls et al. I have learned there are anti flicker scripts.... oh man, brave new world.
shortrounddev2almost 2 years ago
I have coworkers who only use 2 of chromes debugging tools: the console and the network tab. They dont know about breakpoints, mapped typescript&#x2F;react files, or local overrides. Every time they come to me with some issue they&#x27;re facing, I have them set up breakpoints first before we do anything. Usually that&#x27;s all that we need to do, and we figure out the problem in about 5mins
评论 #36894008 未加载
评论 #36895995 未加载
评论 #36893260 未加载
评论 #36902775 未加载
Thoeu388almost 2 years ago
There is Linux command that throttles speed on network interface. You can fully automate loading speed test, and run it as part of integration tests.