Roots Discourse

BrowserSync super slow to refresh

Hey, i’ve been using sage for the last handful of sites i’ve developed and I am really enjoying it. One thing thats driving me absolutely crazy is the speed in which browser sync refreshes. Sometimes I wait over 30 seconds. It seemed to be alright with the first couple of sites but is progressively getting worse.

This is massively slowing me down and becoming a bit of an issue.

Currently I am just running wp through Local (by FlyWheel), with the latest version of Sage for the theme.

I’ve had a look around and noticed other people have had a similar issue but I haven’t come across any solutions.

Has anyone managed to sort this out?

Thanks in advance.

1 Like

Hard to say with zero insight into what changes you’ve made to your styles :slight_smile:

If you’re running your domain on .local change it. Local by FlyWheel doesnt work well with browsersync. Change it to .loc or something else.

@tbdjarrad - is the problem when your browser actually reloads the page, or when you save a file after it’s loaded and the changes are compiled and injected into the browser?

As @benword indicated, we probably need more information about what you’re building (CSS, JS).

When you run yarn build, does it also take a long time? Are any of the resulting files particularly large?

If yarn build is slow too, running webpack --progress --colors --profile --display-modules --display-reasons --display-error-details --config resources/assets/build/webpack.config.js from the command line in your theme folder may help you debug what’s taking so long.

Have you checked if your host machine’s system resources look good (RAM, CPU, disk IO), especially when changes are saved, compiled, and pushed to the browser?

When you load the page at your devUrl instead of via BrowserSync, does it load quickly?

@gregghenry Using a .local domain shouldn’t have any impact on anything.

Likewise, Local by Flywheel shouldn’t impact this if the problem is actually with BrowserSync or the build process, and not with WordPress being able to generate the page to begin with–unless something isn’t configured correctly or the host system just doesn’t have the resources to handle both the VM and the build process/BrowserSync. This is because the processes involved when BrowserSync is running live on the host machine, not in Local’s VM. If the site runs slowly when pages Local’s VM (PHP, MySQL, etc.) is building and serving the page, that’s another question.

I know .local shouldn’t impact anything, but it did for me, which is why I made not of it. I hadn’t looked it up in a while, but it has been addressed here

@tbdjarrad Try enabling IPv6 lookup


@gregghenry oh, good call, I didn’t know there was a Mac-specific issue with the .local TLD. Thanks for providing the additional information.

@gregghenry Thanks heaps man! That was definitely what was causing it.

1 Like