I know there are a few threads out there already talking about this, but I feel like I’ve tried everything and I’m not getting anywhere. It’s driving me nuts. Since google acquired .dev everything has been going pear shaped. Browsersync is running so slowly it’s almost impossible to use. In fact, it’s quicker just to view my site as normal and refresh the page after running yarn build.
I’m on Mac OS X 10.15.3. My development browser is Safari 13
My local virtual host is set up as http://keelmanslodge.local which loads lightning fast when loaded up in safari.
I’ve tried using a old other than .local but I can never get it to work again (on this particular site). When changing pages within the wordpress site is when performance is worse, I’m often waiting in excess of 15 seconds for a page to start loading. Then it loads with no css, and painfully start to inject it slowly over the course of the next minute or so. Then it loads all of the changes I’ve made to my sass files during this “yarn start” session. This takes another 15-30 seconds while I watch everything move around and back again. The sass build time is usually around 4000ms or so everytime I make a change.
Can someone help with all of this, it’s nightmare at the moment!
Now it’s started reloading the whole page every time I save a sass file. It’s never done this before but I haven’t changed a thing with virtual hosts, my config or apache or anything. It’s just randomly started doing it…
Any help would be really appreciated. web packs behaviour has started getting bizarre and unpredictable lately, but I have no idea why…
Here’s a quickfix (3 lines of code to change) that adds an option to disable browserSync in Sage 9:
You can then disable browserSync in your config.json like so:
"enabled": {
"browserSync": false
}
Once disabled, you can run yarn start to run webpack in a basic watch + rebuild mode. You have to manually refresh your pages but, for me, it’s not too bad.
I believe its most probably the result of Bonjour IPv6 lookups being issued for DNS lookups on .local domains. These IPv6 lookups create a timeout delay until the original IPv4 DNS lookup is issued.
A couple of solutions you can try,
change .local to .dev and that wont trigger Bonjour lookups on macOS.
You can alternatively add additional ipv6 entry i.e.
Thanks for the recommendation ali, already done that. As I said it loads very quickly when bypassing webpack and just loading the .local domain straight in the browser.
<VirtualHost 0.0.0.0:80>
DocumentRoot "/Users/ralphonz/Sites/Projects/Keelmans_Lodge/2019.Website/5.Site/public_html"
ServerName keelmanslodge.local
ServerAlias www.keelmanslodge.local
<Directory /Users/ralphonz/Sites/Projects/Keelmans_Lodge/2019.Website/5.Site/public_html>
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Require all granted
Header set Access-Control-Allow-Origin "*"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
</Directory>
</VirtualHost>
Trying using <VirtualHost 0.0.0.0:80> rather than <VirtualHost *:80>
To be honest that didn’t make a difference but I left it there anyway.
The problem with using .dev, or most other tld’s is the SSL requirement. I tried to set up a self-signed certificate but it keeps redirecting me to the standard “It Works!” page rather than the ones in my Sites folder. Can’t find a decent guide on how to get https working on localhost.