Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
WP Rocket - Advanced Options Prefetch DNS requests examples
//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
//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
//i0.wp.com
//i1.wp.com
//i2.wp.com
//stats.wp.com
//pixel.wp.com
//s.gravatar.com
//0.gravatar.com
//2.gravatar.com
//1.gravatar.com
@lukecav
Copy link
Author

lukecav commented Jun 23, 2017

@invad3r
Copy link

invad3r commented Nov 16, 2018

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

@tonyosuna
Copy link

tonyosuna commented Nov 27, 2018

Thanks you for sharing.

@OpusLA
Copy link

OpusLA commented Dec 14, 2018

Just what I was looking for. Thx a bunch.

I added:

//i.ytimg.com

For YT thumbnails

@iamkingsleyf
Copy link

iamkingsleyf commented Jan 20, 2019

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

@DaBomby
Copy link

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
Copy link

jaisiyaram1 commented Nov 5, 2019

Awesome!

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

@lukecav
Copy link
Author

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.

@lukecav
Copy link
Author

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
Copy link

vijaygarg-ahead commented May 27, 2020

Thanks :)

@lukecav
Copy link
Author

lukecav commented May 27, 2020

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

@DaljitKhalsa
Copy link

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
Copy link
Author

lukecav commented May 31, 2020

With www is fine on those sites.

@lukecav
Copy link
Author

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

@caryn581
Copy link

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

@mejbabiplob
Copy link

mejbabiplob commented Jul 2, 2021

assume list

@mfurqanhaider
Copy link

mfurqanhaider commented Sep 22, 2021

Thanks Luke for DNS prefetching list. I have applied on my website but still performance is not good. What others things to consider for the best speed performance.
image_2021-09-22_124312

@lukecav
Copy link
Author

lukecav commented Sep 22, 2021

@us7p
Copy link

us7p commented Dec 27, 2021

//twitter.com
//facebook.com
//onesignal.com
//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
//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

@hashibwd
Copy link

hashibwd commented Oct 21, 2022

Thank you for sharing.
HashibWD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment