I've been trying for a few days to improve the speed of loading sites on my MacBook. Here are some of the things I've tried already from searching the forums:
Ensure the IPv6 address is in setupVars.conf (my ISP doesn't support IPv6 but my router does via 6to4 tunnelling)
Add a firewall rule to REJECT all requests to 443
I've added OpenDNS and Google as IP4 & 6 DNS providers
Ensuring I have the latest updates of Pi Hole and Raspbian installed
Any help trying to figure out why many sites are slow would be muchly appreciated
Expected Behaviour:
Sites should be loading faster than with pi hole disabled
Actual Behaviour:
Some ad heavy sites, e.g. www.wetter.com load very slowly
Open up the dev tools (F12) and then reload the site. Look in the Network tab for any requests which take a long time (>2 sec) and take note of those. Are they all blocked requests? For me, that site loads very quickly, without ads.
If I copy the URL of one of the scripts that takes a while to fetch, then paste it into a new tab, then it takes a while and eventually displays a "Problem loading page" message, so a 404. Seems to me it takes quite some time to wait for the blocked page before giving up with a 404.
I went into my DNS settings on my computer, and found two entries. One is the IPv4 address of my router and the other is the IPv6 address of my router. If I manually add the IPv4 address of my Pi Hole machine, then everything loads much quicker.
In my router (a FRITZ!Box 6490) I had manually entered the DNS server to be the IPv4 and IPv6 of the Pi Hole device.
Aha! I've cracked it. The FRITZ!Box is a pain to configure... For the benefit of others, I had specified the DNS Server under Internet -> Account Information -> DNS Server but that's not correct. It's necessary to go into Home Network -> Home Network Overview -> Network Settings -> IP4/6 Addresses then enter the IP address of the Pi Hole device under "Local DNS server".
Thanks for your fast help though, Mcat12! It helped me at least narrow down the problem.
I experienced the same issue:
--Slow loading of some websites
--Only from mobile and not from desktop
--On mobile only from browser and not from apps
I used tcpdump to gather a full pageload of the troublesome site from mobile and saw that the mobile device stalls for a minute a couple of times on CDN's.
I used tcpdump to gather the same pageload from desktop and did not see the traffic stalling. Page loaded in 2 secs instead of three minutes.
When comparing the two dumps I see that the traffic for mobile is different from the traffic from desktop. Different CDN's are used as well as the mobile using proxies to supposedly speed up pageloads. Traffic from proxy to CDN seems to be stalling the loads.
I also noticed that Pi Hole Always responded within milliseconds so is not the problem.
I will do further investigation and report back when I know more..
Some further results:
-Some websites load quick, others take minutes.
-Loading the 'slow' websites via 4G loads them quickly.
-Loading the 'slow' websites when PI Hole is disabled loads them quickly.
The above combined with the data from earlier post lets me assume that somewhere in the chain of CDN's a request for ads is blocked by pi-hole and is disrupting this chain of events. This will lead any of the CDN's to wait for a time-out. This causes the slowness.
Next thing I will do is whitelist all the blocked requests for a certain 'slow' page to prove the point...
Whitelisting does not help for this case. The problem is still that a site (google analytics in my case) is taking a minute to respond back, thus holding up the rest of the traffic. No clue why this only happens with mobile requests...
BTW: I tried to ask for the desktop page in the browser but that does not solve the issue...