{"id":2922,"date":"2022-01-12T14:48:06","date_gmt":"2022-01-12T14:48:06","guid":{"rendered":"https:\/\/cherylroll.com\/your-guide-to-core-web-vitals-tactics-using-cloudflare-and-webpagetest-350763\/"},"modified":"2022-01-12T14:48:06","modified_gmt":"2022-01-12T14:48:06","slug":"your-guide-to-core-web-vitals-tactics-using-cloudflare-and-webpagetest-350763","status":"publish","type":"post","link":"https:\/\/cherylroll.com\/your-guide-to-core-web-vitals-tactics-using-cloudflare-and-webpagetest-350763\/","title":{"rendered":"Your guide to Core Web Vitals tactics using Cloudflare and WebpageTest"},"content":{"rendered":"
One of the best ways to be able to perform tactical edits to webpage code and improve Core Web Vitals scores is to set up a comparison, like A\/B testing. As a developer you can run Lighthouse in your local development environment and test as you make changes. It is still useful to tests production code, which you have to do anyway when you’re not the developer.<\/p>\n
We used a nifty demonstration stack in our Core Web Vitals Site Clinic just last December in the SMX Build: SEO for Developers.<\/a><\/strong> We will continue to use it in the upcoming SMX Master Class training<\/a>, and from now onward with our SEO for Developers series of posts.<\/p>\n Here is how to test Core Web Vitals scores and code changes using Cloudflare Workers as a reverse proxy<\/a> and WebpageTest. All these services are free and we’re certainly not the first to use them. Patrick Meenan<\/a>, WebpageTest developer, thought it all up. We’ll outline how to get started without all the heavy lifting.<\/p>\n The Cloudflare Workers app gives us our reverse proxy testbed and transforming code using the proxy environment. While a playground at cloudflareworkers.com exists, fragmented URLs at that address prevent us from testing without a Cloudflare account (the free one works). You do not need a WebpageTest account.<\/p>\n Once you’ve got a Cloudflare account, navigate to Workers and click to create a new worker with the Create a Service button. This will populate a sample JavaScript worker with a UI editor you can access with the Quick Edit button. Each worker you create gets a unique URL. You can rename it at any time. We set one up at: https:\/\/sel.deckart.workers.dev<\/a> for this purpose.<\/p>\n If you navigate, notice the “x-host header” requirement. The requirement limits requests to testing. We use a browser extension to modify requests, add the x-host header needed to supply the script with the host we want to test. Let’s modify requests in your browser so we can view the page, view-source, and run DevTools.<\/p>\nCloudflare and WebpageTest<\/h2>\n
Navigate Tests with ModHeader<\/h2>\n