Nine41 Consulting | Fix Safari’s Slow Page Loads So You Can Ditch Google Chrome on macOS Sierra
apple, device management, dep, vpp, systems management, landesk, ivanti, lanrev, absolute, heat, mdm,
976
post-template-default,single,single-post,postid-976,single-format-standard,qode-quick-links-1.0,ajax_fade,page_not_loaded,,columns-3,qode-child-theme-ver-1.0.0,qode-theme-ver-11.0,qode-theme-bridge,wpb-js-composer js-comp-ver-5.1.1,vc_responsive
 

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.

Detection:

#!/bin/sh

# 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
 else
 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
fi

Repair:

#!/bin/sh

# 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

ARE YOU READY TO GET STARTED?
Please fill out your information, and a specialist will reach out to discuss our services in more details.
Your Information will never be shared with any third party.
        
Free Training Videos
Register to gain access to all of our free content.
YOUR PHONE
YOUR NAME
YOUR EMAIL
        
Get Started
Provide us your contact information and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
        
Additional Questions?
Provide us your contact information and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
        
Pay by PO?
Provide us your contact information and we will reach out to help you sign up by PO.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Subscribe Now
Subscribing to our site gives you access to our Apple Admin 101 training videos as well as allowing us to notify you of each new blog post we release.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Pay by PO
Send us your contact information and we will reach out to help you sign up by PO.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Additional Questions?
Send us your contact information and your questions and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
YOUR QUESTIONS
Get Started
Provide us your contact information and we will reach out as quickly as possible.
YOUR PHONE
YOUR NAME
YOUR EMAIL
Free Training Videos
Subscribing to our site gives you access to our Apple Admin 101 training videos as well as allowing us to notify you of each new blog post we release.
FIRST NAME
LAST NAME
PHONE
EMAIL
Subscribe Now
Subscribing to our site gives you access to our Apple Admin 101 training videos as well as allowing us to notify you of each new blog post we release.
FIRST NAME
LAST NAME
PHONE
EMAIL