Skip to content

Instantly share code, notes, and snippets.

@lukecav
Last active March 30, 2024 20:53
Show Gist options
  • Star 83 You must be signed in to star a gist
  • Fork 36 You must be signed in to fork a gist
  • Save lukecav/9931c3f6e402e23f58065d6b2665ef5b to your computer and use it in GitHub Desktop.
Save lukecav/9931c3f6e402e23f58065d6b2665ef5b to your computer and use it in GitHub Desktop.
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 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

Thanks :)

@lukecav
Copy link
Author

lukecav commented May 27, 2020

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

@DaljitKhalsa
Copy link

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

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

assume list

@mfurqanhaider
Copy link

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

@isabellaabigail
Copy link

Hey Luke, I applied this DNS prefetching list.

//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

But still my website speed is 90 how can improve this speed more.

Loklok APK

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