• Good afternoon!
    I have a swift template.

    The order of loading in <head> is as follows:
    1.

    <script custom-element=”amp-form” src=”https://cdn.ampproject.org/someamp-script.js” async>

    2.

    <meta charset=”utf-8″>

    3.

    <link rel=”dns-prefetch” href=”//cdn.ampproject.org”>

    // I understand that you added it.
    4.

    <meta name=”viewport” content=”width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=2,user-scalable=yes”>

    5.

    <link rel=”preconnect” href=”https://url” crossorigin>

    // written by me in “Advance Settings”->”DNS Priority of the URL(s)”

    But this build logic does not speed up the download.

    Point 1 can be moved closer to < / head>. At the very beginning, it is definitely not needed. It is being initialized, although you later have a dns-prefetch to this domain. Despite the async, the appeal has already started. Personally, I have in point 5

    <link rel= “preconnect” href=”https://cdn.ampproject.org” crossorigin>

    . Here I make a full internet connection with https://cdn.ampproject.org from which, in fact, all scripts are loaded.
    And I have it after points 1 and 3.

    Having

    <link rel= “preconnect” href=”https://cdn.ampproject.org” crossorigin>

    doesn’t need item 3 with

    <link rel= “dns-prefetch” href= “//cdn.ampproject.org”>

    . Since the connection to this resource is quite long to download (look at the webmaster tool in Chrome). And here to be limited only to DNS as for me not the best solution.
    Point 3 in my case only duplicates. If there was a preconnect, I would not manually register it.

    I do not insist on the truth, but it seems to me the best loading logic would be: 2,4,5,1. And point 3 to remove or replace dns-prefetch with preconnect.

    • This topic was modified 3 years, 5 months ago by eddie.
    • This topic was modified 3 years, 5 months ago by eddie.
    • This topic was modified 3 years, 5 months ago by eddie.
    • This topic was modified 3 years, 5 months ago by eddie.
    • This topic was modified 3 years, 5 months ago by eddie.
    • This topic was modified 3 years, 5 months ago by eddie.
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘initialization logic’ is closed to new replies.