Troubleshooting a 4-5sec delay before any WebKit content starts loading (even local content)
Since a few days, the strangest thing has been happening on my Mac running macOS 14.2.1 23C71: when I open a new Safari tab and type in the address of any website (even a localhost address), it takes about 5 seconds before the page starts loading. The loading itself is fast (I have a fast internet connection), but there seems to be a delay before it starts loading.
Important detail: during this loading, no network activity is observable (neither in the WebKit Inspector nor via tools like Proxyman).
I think a connectivity problem can already be ruled out, because:
- I have emptied the browser cache, cleared the DNS cache, uninstalled AdBlocker, set alternative DNS servers, rebooted several times, installed latest updates etc.
- I have tried it via other Internet connections (even in other physical locations), via Wi-Fi and Ethernet.
The problem always consistently persists, but (also important): it does not occur in other (non Webkit browsers) such as Chrome, Arc and Firefox. There, loading starts immediately.
So my preliminary conclusion is that it has something to do with Webkit itself, and more specifically with the WebKit System Framework. This suspicion is reinforced by the fact that in Mimestream, the email app I use, I notice the same delay in loading emails when I open them in a new window (thus presumably loading a new instance of the Webkit System Framework). I made a small video to demonstrate this:
- Issue demonstrated in Safari
- Issue demonstrated in Mimestream (which uses Webkit to render emails)
Here are a few more things I tried:
- I emptied all caches and closed all background processes (as far as possible.
- I have reset all network settings.
- I uninstalled and reinstalled Mimestream (and all settings).
- I ran sudo killall -HUP mDNSResponder.
- I restarted the computer in Safe Mode.
- I installed Safari Technology Preview (which contains a new version of Webkit) and the same problem occurred there.
Finally, I created a completely new macOS profile. There the problem does not occur! There, the Webkit content loads immediately.
So, there must be a setting somewhere (or a plist setting) that introduces this strange "delay" when loading Webkit content.
The issue is that switching to a new profile would mean starting from scratch, which is not ideal since my current profile is extensively configured with settings, software licenses, etc. It would take days to reproduce that environment. So, I suspect there is a small setting somewhere that I am overlooking, but I don't know what it could be.
I appreciate any help!