Support » Fixing WordPress » Remove the new dns-prefetch code

  • Hello,

    How can I remove the new dns-prefecth code added to my website since the new update ?

    <link rel='dns-prefetch' href='//fonts.googleapis.com'>
    <link rel='dns-prefetch' href='//s.w.org'>

    Thanks

Viewing 8 replies - 16 through 23 (of 23 total)
  • As of 4.7, the “hints” code above does not work. I’d like to remove all the dns-prefetch stuff that jetpack is adding.

    Jeremy Herve

    (@jeherve)

    Jetpack Mechanic 🚀

    Hi,
    I have the 3 pre-fetch codes in my site and have no problems with the bottom 2 prefetchs. But I need to remove the s3.amazonaws.com prefetch because I have a real estate web-site and it conflicts with the maps. I have no idea why this is.
    I did find a code and put it in functions.php but it kills the other 2. I just want to remove the amazon code
    I am a total beginner. Could you help me with the code and tell me where to put the code in. God Bless you for helping me.
    <link rel=”dns-prefetch” href=”//s3.amazonaws.com”>
    <link rel=’dns-prefetch’ href=’//fonts.googleapis.com’>
    <link rel=’dns-prefetch’ href=’//s.w.org’>

    Maybe it’s supposed to improve performance, but in reality all I’ve seen it do is slow websites down.

    And yes the 404 error is important.

    Seriously, all this just get an IP address?

    • Why would the browser even need the IP address for WordPress.org when loading my website?
    • And DNS loading time is typically insignificant when it comes to page load speed.
    • And a 404 during the prefetch slows the page load time by seconds not the milliseconds a DNS takes. Doesn’t it? Wouldn’t the browser try to make that connection to get an IP address (the whole point of prefetch) and then have to wait for a response, of which 404 is one of the slowest.

    But can I ask why? It’s there to improve the performance of your site.

    Can you explain to me HOW it could POSSIBLY improve performance?

    This could NEVER improve performance. In fact it will almost ALWAYS have the opposite effect. The first time someone visits a url – yes the prefetch will cause the page to be slightly faster – but every page after that first one – will load slower. Why? Because by prefetching the script completely ignores built in browser caching and prefetches the URL despite the fact its already stored by the browser.

    If you doubt this – open your wordpress site in Chrome. Then visit chrome://net-internals/#dns

    See all those DNS entries that relate to wordpress? Yeah by prefetching – you ignore them completely and force the browser to go our onto the internet to get information it already stores in cache.

    This is something that was developed by browser vendors for performance reasons, WordPress didn’t just make it up.

    If a browser already has the location of a domain cached then it doesn’t need to use the prefetch links so it won’t bother.

    If it isn’t aware of the location of the domain then it can possibly look up the location before it gets to an asset that needs to be downloaded from that domain. If it doesn’t have the time idle to do that then the ip lookup will be done at the time the asset is needed (IE the prefetch does nothing).

    Chrome does it by default anyway, the tags are just explicitly telling it which domains are used on the site.
    https://www.chromium.org/developers/design-documents/dns-prefetching

    Thank you so much for the reply

    In my case I have a real estate web-site and Amazon Pre-fetch java scripts interfere with the one that render maps. I think that they are leaflets.

    I wish I could have kept all these codes. Can someone tell me how to just remove the Amazon pre-fetch and not the other two?

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘Remove the new dns-prefetch code’ is closed to new replies.