We help top organizations stay competitive, by implementing the latest disruptive technologies.

Latest Posts

Fix Safari’s Slow Page Loads So You Can Ditch Google Chrome on macOS Sierra

Fix Safari’s Slow Page Loads So You Can Ditch Google Chrome on macOS Sierra

Are you frustrated with how slow Safari loads its web pages?  Are you also fed up with Chrome turning your Mac into a full blown wind turbine and draining the battery on your laptop all too fast? Well I was too, until this morning when I was up at 3 AM and sick and tired of Safari loading so slow and Chrome causing my Mac to sound like it was going to fly off my desk.

Why I didn’t google this years ago, I don’t know.  But this morning, I found a way to fix Safari’s slow page loads allowing me to ditch Google Chrome…at least for those websites that don’t require Java.  The tweak is not perfect, not every website I tried responded as fast as Google Chrome, but Safari’s performance is much better – and doesn’t run my fans at full speed so I’ll take what I can get for now.

In your own testing, just make sure to quite and re-launch Safari after you’ve made the change.

To be honest, the part that frustrates me about my browser dilemma the most is that I’ve been suffering with mediocre performance for so long with an all too simple fix available.  To bring Safari back to life, just disable Safari’s DNS prefetch with the simple Terminal command below.  Thanks to WebNots, for providing this little gem of a trick in this article.

defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false

Give it a shot and see how it works for you.  For me, well, I’ve removed Google Chrome from my Dock and excited to enjoy the peace and quiet in my office.

If you’re a LANDESK Management Suite user, you may want to create a patch definition that will disable the DNS prefetch. By setting the definition it to Autofix, you can make sure your users macOS devices are always optimized for fast page loading.  I’ve built a custom definition and made it available on my GitHub page a long with the scripts I used within the definition.

The definition, at this time, is designed for a single user to machine scenario – as I don’t check for all users.  But nonetheless, it can be enhanced with a little bit of effort.

For ease in writing your own scripts if a non-LANDESK user, my detection script and repair scripts are below.



# WebKitDNSPrefetching Detection.sh
# Created by Bennett Norton on 10/3/16

# The WebKitDNSPrefetching setting is found at /Users/$username/Library/Preferences/com.apple.safari WebKitDNSPrefetchingEnabled
safariPrefetchSetting=( $( defaults read com.apple.safari WebKitDNSPrefetchingEnabled ) )

# compare the returned value with your desired state
# a safariPrefetchSetting of 0 means it is disabled - this is what you want if you want to speed up the browser
# a safariPrefetchSetting of does not exist means it is enabled 
if [[ $safariPrefetchSetting == 0 ]] ; then
 echo "Found: The option for 'WebKitDNSPrefetching' is already disabled"
 echo "Reason: The value for 'WebKitDNSPrefetching' is: $safariPrefetchSetting."
 echo "Expected: The value for 'WebKitDNSPrefetching' should be Manual"
 echo "Detected: 0"
 exit 0
 echo "Found: The option for 'WebKitDNSPrefetching' is currently enabled"
 echo "Reason: The value for 'WebKitDNSPrefetching' is currently applied"
 echo "Expected: The value for 'WebKitDNSPrefetching' should be disabled"
 echo "Detected: 1"
 exit 1



# disableSafariPrefetch.sh
# Created by Bennett Norton on 10/03/16.
# This script will disable the prefetching for Safari

defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false
No Comments

Post A Comment