29 July 2015, 09:03
A persistent issue I’ve had across several Macs is Facebook not loading correctly in Safari. The site’s text appears but the stylesheet/CSS doesn’t load, so it looks a mess and is unusable.
The reason for this is bizarre. Facebook (and other sites that you might have this problem with) use HTTPS for some of their data, and HTTP for basic things like stylesheets.
HTTPS relies on your system time being accurate. And the time on Macs might not be.
If you open System Preferences, and click Date & Time, you’ll probably see that there’s a check alongside Set Date and Time Automatically. Things should be fine, right?
It appears, crazily, that Apple’s time servers (NTP) are a few seconds wrong.
And would you believe the solution to this problem might speed-up Safari too?
EDIT: See below.
That solution is to click in the server field alongside the checkbox mentioned above and type the following – you can indeed type there, rather than just choose from the three choices in the dropdown list: pool.ntp.org This uses the central Internet NTP time server. Load Facebook. You’ll see things are fixed. Weirdly, you might find your browsing is now speeded up too. There might not be a delay with Google searches taking place from the omnibar of Safari — and again, it’s no coincidence that Google searches in Safari are done via HTTPS.
EDIT: This is a rabbit hole of a bug in Mac OS X that apparently surfaced in Mavericks and continues in Yosemite.
The issue is that the NTP server in OS X is unreliable. This post on the Apple Discussion Forums explains why (it’s to do with power saving and file caching), but there isn’t really an acceptable solution. Some people recommend installing a different version of the NTP software but, as mentioned, this will interfere with power saving. On an iMac, Mac Mini or Mac Pro that’s not a huge issue but it is on MacBooks.
One solution I’m trying right now is to set the time manually on OS X — that is, remove the check from Set Date and Time Automatically in System Preferences — and to retard the time a few seconds according to this website, which shows atomic clock-accurate standard time. In other words, if the official time is 10.20 and 30 seconds, you set your clock to 10.20 and 27 seconds. This approach seems to be working for me at the moment but the “drift” that messes things up happens over the space of hours and days, so I’m not yet sure if it’s a long term solution.