Slow loading for some webpages on first attempt

Please follow the below template, it will help us to help you!

Expected Behaviour:

When I request a website it starts to load within a second.

Actual Behaviour:

Many websites take about 10-20s to load, including www.google.com, www.facebook.com. When going to these a second time (having closed the page) they load nearly instantly. After 10 minutes or so the slow behaviour can return. Other websites are unaffected and load nearly instantly.

Debug Token:

https://tricorder.pi-hole.net/0dgicpkw0b

I have just setup Pi-hole on an old RaspberryPi 1 connected to me router which I changed the Primary DNS Observing the log in real time I have seen slow queries for both [AAAA] and [A] requests.

I have read various pages about this issue that suggest adding entries to iptables but these were all for <v4.0 . As far as I understand this had been resolved in newer versions and no longer necessary. Is this true or should I still try the suggestion on Why Some Pages Load Slow When Using Pi-hole And How To Fix It (for versions < v4.0) - Pi-hole ? If not, can you suggest anything else to try?

Basically what is happening is a caching issue the website IP gets cached the first time making subsequent page loads quicker

are there any error in the dev tools (F12) of your browser?

Yes, I checked the console in the dev tools and I have the following errors for www.cnet.com

Error: Script error http://requirejs.org/docs/errors.html#scripterror [require-2.1.2.js:6:932](https://cnet2.cbsistatic.com/fly/js/libs/require-2.1.2.js)

makeError https://cnet2.cbsistatic.com/fly/js/libs/require-2.1.2.js:6
onScriptError https://cnet2.cbsistatic.com/fly/js/libs/require-2.1.2.js:6

and

Error: Load timeout for modules: version!libs/ads/bidbarrel http://requirejs.org/docs/errors.html#timeout [require-2.1.2.js:6:932](https://cnet2.cbsistatic.com/fly/js/libs/require-2.1.2.js)

makeError https://cnet2.cbsistatic.com/fly/js/libs/require-2.1.2.js:6
C https://cnet2.cbsistatic.com/fly/js/libs/require-2.1.2.js:6
s https://cnet2.cbsistatic.com/fly/js/libs/require-2.1.2.js:6

what other adblocking scripts (uBlock origin etc) are you running you debug shows pihole is functioning as expected

I had one computer with nothing, just standard firefox, and the other with Ad Block Plus. They both exhibited similar behaviour. I've now turned off ABP and some websites are still very slow to load. I have captured a log file which shows a 21 second delay between the following consecutive entries

 query[A] www.twitter.com from *my router*
 forwarded www.twitter.com to 1.0.0.1

followed by another 104 entries in the same second.

During this period the desired webpage is blank.

Could the pi's processor load running continuously at over 1 (between about 1.3 and 2)? This is on a fresh install of Raspbian Buster with nothing else than pi-hole running.

sounds like there is something else going on with your device and network.

21s is ridiculous for DNS requests. There is a chance your router is causing the delay in some way as it would appear to be doing a DNS relay of some kind.

also in terms of CPU load i have 3 or 4 services running and rarely get above 0.1 in terms of loads

I had the same issue for a period of time, but I couldn't find what was behind that. Since i have unbound installed and Pihole is working with it, the slow-loading-effect is gone.

This can be due to obsolenscence of browsers chached data (DNS and content). Once a site was successfully connected and loaded, it is "known" for the browser, but after a period of time the browser will declare these data as obsolete and will reload parts or everything when you visit the site again.

Did you install and configure "unbound" as described on Redirecting... or do you have some other setup?

I did exactly this and its working instantly and fine.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.