Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WP Rocket - Advanced Options Prefetch DNS requests
//maps.googleapis.com
//maps.gstatic.com
//fonts.googleapis.com
//fonts.gstatic.com
//ajax.googleapis.com
//apis.google.com
//google-analytics.com
//www.google-analytics.com
//ssl.google-analytics.com
//youtube.com
//api.pinterest.com
//cdnjs.cloudflare.com
//pixel.wp.com
//connect.facebook.net
//platform.twitter.com
//syndication.twitter.com
//platform.instagram.com
//disqus.com
//sitename.disqus.com
//s7.addthis.com
//platform.linkedin.com
//w.sharethis.com
//s0.wp.com
//s1.wp.com
//s2.wp.com
//s.gravatar.com
//0.gravatar.com
//2.gravatar.com
//1.gravatar.com
//stats.wp.com
@lukecav

This comment has been minimized.

Copy link
Owner Author

@lukecav lukecav commented Jun 23, 2017

@invad3r

This comment has been minimized.

Copy link

@invad3r invad3r commented Nov 16, 2018

Awesome! Thanks for this list, I appreciate your effort.

@tonyosuna

This comment has been minimized.

Copy link

@tonyosuna tonyosuna commented Nov 27, 2018

Thanks you for sharing.

@Thrillnetwork

This comment has been minimized.

Copy link

@Thrillnetwork Thrillnetwork commented Dec 14, 2018

Just what I was looking for. Thx a bunch.

I added:

//i.ytimg.com

For YT thumbnails

@iamkingsleyf

This comment has been minimized.

Copy link

@iamkingsleyf iamkingsleyf commented Jan 20, 2019

for jetpack cdn is not complete, there is s0, s1, s2

@DaBomby

This comment has been minimized.

Copy link

@DaBomby DaBomby commented May 9, 2019

Here are a few more to consider adding:

//www.googletagmanager.com
//www.googletagservices.com
//adservice.google.com
//pagead2.googlesyndication.com
//tpc.googlesyndication.com
//bp.blogspot.com
//1.bp.blogspot.com
//2.bp.blogspot.com
//3.bp.blogspot.com
//4.bp.blogspot.com
//ajax.microsoft.com
//ajax.aspnetcdn.com
//s3.amazonaws.com
//code.jquery.com
//stackpath.bootstrapcdn.com
//use.fontawesome.com
//player.vimeo.com
//github.githubassets.com
//referrer.disqus.com
//c.disquscdn.com
//0.gravatar.com
//2.gravatar.com
//1.gravatar.com
//ad.doubleclick.net
//googleads.g.doubleclick.net
//stats.g.doubleclick.net
//cm.g.doubleclick.net
//stats.buysellads.com
//s3.buysellads.com

@jaisiyaram1

This comment has been minimized.

Copy link

@jaisiyaram1 jaisiyaram1 commented Nov 5, 2019

Awesome!

How to optimise other ad networks like Media.net, Taboola etc.. .

@imukesh1337

This comment has been minimized.

Copy link

@imukesh1337 imukesh1337 commented Jan 9, 2020

Thanks for this list but can anyone please explain by adding all these URLs in WP-Rocket URLs to prefetch. How can it help our website? Is it safe? Or How it will help I tried it on my website and still page speed loading is very low. Please guide me if possible Thanks

@raxlogo

This comment has been minimized.

Copy link

@raxlogo raxlogo commented Jan 31, 2020

Thank you.. My website called custom logo still running slow. Please help.

@lukecav

This comment has been minimized.

Copy link
Owner Author

@lukecav lukecav commented Apr 16, 2020

for jetpack cdn is not complete, there is s0, s1, s2

Updated to include those if a someone is using the Image CDN/Asset CDN in Jetpack.

@DaljitKhalsa

This comment has been minimized.

Copy link

@DaljitKhalsa DaljitKhalsa commented May 13, 2020

Hi there, Should I copy-paste the list on the website even if I do not use those websites at all. For example, in the list, I do not use this service at all //s3.buysellads.com

So should I still add this URL in the list or do I have to cherry-pick from the list?

Or if I can copy-paste all the list it will not affect the performance? I am using the whole list on my own website https://www.khalsa-website-designers.net/ but I do not know if enabling or disabling effect on the performance and if I should copy-paste the full list given above or should I only copy-paste the services I use.

@lukecav

This comment has been minimized.

Copy link
Owner Author

@lukecav lukecav commented May 13, 2020

You only need to DNS prefetch the external URL requests being made on your site. I would check the site using
https://www.webpagetest.org/

Then look for all of the external URL requests.

@vijaygarg-ahead

This comment has been minimized.

Copy link

@vijaygarg-ahead vijaygarg-ahead commented May 27, 2020

Thanks :)

@DaljitKhalsa

This comment has been minimized.

Copy link

@DaljitKhalsa DaljitKhalsa commented May 27, 2020

Hi brother Lukecav, Thank you very much. I have checked that website page test .org website and I found the list of domains I should add. Here is the screenshot = http://prnt.sc/sov9vv

But I have another question now. The question is that do I have to add these lines before the domain //
Or should I not add those lines before the domain?

In other words: Should I add domains like this:
http://prnt.sc/sovazp
or like this
http://prnt.sc/sovbu1

@lukecav

This comment has been minimized.

Copy link
Owner Author

@lukecav lukecav commented May 27, 2020

You will need to add // before the domain name.

@DaljitKhalsa

This comment has been minimized.

Copy link

@DaljitKhalsa DaljitKhalsa commented May 30, 2020

Hello brother Lukecav. You have helped me to get this issue nearly solved and those who had questions like me they will get the help for the lifetime from this post and comments.

Brother one last question. What about those domains which have www. before the domains?

Example:
www.google.com
www.googletagmanager.com
www.google-analytics.com

Should we be adding these domains like this:
//www.google.com
//www.googletagmanager.com
//www.google-analytics.com

or like this:
//google.com
//googletagmanager.com
//google-analytics.com

Thank you in advance.

@lukecav

This comment has been minimized.

Copy link
Owner Author

@lukecav lukecav commented May 31, 2020

With www is fine on those sites.

@juraganfilmmovie

This comment has been minimized.

Copy link

@juraganfilmmovie juraganfilmmovie commented Jun 5, 2020

hi sir , i use all of thoe list on my website , is that ok or it will slowing down my site ? or should i only use several important ?

@lukecav

This comment has been minimized.

Copy link
Owner Author

@lukecav lukecav commented Jun 5, 2020

Only use the external site URLs that are being requested on your site and no it will not slow your site down, the idea is that the DNS requests that are external will be prefetched for the site user.
https://www.chromium.org/developers/design-documents/dns-prefetching

@DaljitKhalsa

This comment has been minimized.

Copy link

@DaljitKhalsa DaljitKhalsa commented Jun 5, 2020

Brother Lukecav, Your replies are helping people like me who did not know anything about DNS Prefetching. Brother, I want to as you a question and this question may be hitting others mind too.

Let's say I have added nearly 8 domains in the Prefetching. When a user visits the website for the first time. Will all of those 8 domains affect the logging time for the first time user? I mean if someone is visiting for the first time from his device then do you think it will take nearly 1-3 seconds time to Prefetch the DNS for those domains as well and that will make the site slower for the new user?

Or does it work like this --> The user came for the first time. Once the full website is loaded then the browser sends the command to prefetch DNS for all the links on the page.

Another question related to this question:- I always add my website link in the footer of all the websites I create. For example, you can see here https://bestandcheapbondcleaning.com.au/ so on this best and cheap bond cleaning website should I add my domain in the prefetch DNS section too?

@caryn581

This comment has been minimized.

Copy link

@caryn581 caryn581 commented Sep 27, 2020

lukecav - I hope that you or someone else in this forum may be able to clarify this for me. I added //soundcloud.com to my dns prefetch list. I am still having issues (see attached file) Should all these be added too: //wave.sndcdn.com, //w.soundcloud.com

I also came across code.ionicframework.com when running a test - should this be added to my prefetch list as well?

Any feedback would be greatly appreciated!

github ss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.