If Safari is getting very slow:
Adding Open DNS codes to your Network Preferences, should give good results in terms of speed-up as well as added security:
If you are using a single computer: Open System Preferences/Network. Double click on your connection type, or select it in the drop-down menu, and in the box marked 'DNS Servers' add the following two numbers:
(You can also enter them if you click on Advanced and then DNS)
Sometimes reversing the order of the DNS numbers can be beneficial in cases where there is a long delay before web pages start to load, and then suddenly load at normal speed:
If your computer is part of a network: please refer to this page: http://www.opendns.com/start/bestpractices/#yournetwork and follow the advice given.
You could also try these codes as well: 188.8.131.52 & 184.108.40.206
If you use a Router, make sure it has the latest firmware installed.
One reason for a slowness in page loading may be the 'DNS Pre-fetching' feature of Safari 5.x
This is described here:
If Safari seems to hang for ages:
If you have a lot of tabs open and/or a lot of pages running Flash, Safari can sometimes 'hang', requiring a restart of Safari. This can often be inconvenient, and as it is rarely Safari itself that is hanging but merely one of its plug-ins, usually Flash, there is a way using Terminal to restart the plug-ins (without restarting Safari and losing your tabs) by quitting the WebPluginHost process:
Open the Terminal from the Utilities folder in /Applications and type
killall -9 WebKitPluginHost
Note that this command kills all Safari plug-ins, not just Flash. All plug-ins should start back up when you reload the page.
Then go back to Safari and refresh any pages that were using the Flash plug-in. This also fixes the Beachball of Death. Try this whenever Safari gets slow or freezes. The latest versions of Flash 10.1 appear to have improved the situation somewhat, but haven't completed eliminated it.
Just emptying the Safari cache more often can help either from the Safari menu bar, Safari / Empty Cache or Command + Option + E on your keyboard.
Check for Login Items. Open System Preferences/Accounts then select the Login Items tab. Delete any files or apps you have listed there. And go to /Library/Startup Items. Move any files in the Startup Items folder to the Trash.
Try troubleshooting the Safari .plist file. Open a Finder window. Select your Home Folder in the Sidebar on the left. It has a small house icon. Then open the Library folder then the Preferences folder. Move the com.apple.Safari.plist file from the Preferences folder to the Desktop. Now launch Safari. If Safari speeds up loading web pages, then move the .plist file to the Trash.
If you have any Safari Extensions installed, that could be a factor as far as Safari running slow. From your Safari menu bar click Safari / Preferences then select the Extensions tab. Turn that OFF and see if it makes a difference.
And in the Safari Preferences pane select the Security tab. Delete any cookies related to sites that are slow to load. That can help also.
Resetting Safari from the Safari menu bar. Select: *Remove all website icons*, click Reset.
Make sure there is enough free space on the startup disk. Right or control click the MacintoshHD icon. Click Get Info. In the Get Info window you will see Capacity and Available. Make sure you always have a minimum of 15% free disk space.
I was having slow, and sometimes incomplete page loading from Safari 5 on both my desktop and laptop. I first tried running virus checks on both to make sure I didn't have some rare but possible Trojan. Everything came back clear, so I found this post on adding the Open DNS numbers. After adding them to my DNS Servers list I instantly found a huge performance increase! Thanks Klaus!!
Thank you very much for your post! I think this has fixed my probem! Mine was so slow that www.google.com would lag for several seconds. www.nytimes.com would lag so much I could open Firefox and have it opened before Safari loaded it!
Buy why did it occur in the first place? My MacBook Air was running fine in Safari until a few days ago when the pages started to lag when loading. I haven't noticed this on my 2011 Mac Mini, but will check tomorrow.
Does this fix of changing the DNS servers work for both wireless internet via my Airport and when plugged in via ethernet cable on my Mac Mini?
This suggestion for changing the DNS setting to OpenDNS has worked wonders. I'm running 5.1 Safari under Lion, I had read there is a bug / problem with Safari 5.1 causing it to load some web pages very slowly, which was my symptom. Nevertheless your solution has transformed Safari for me. Thanks!!