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.
@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 @ben 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.