Welcome to Centmin Mod Community
Become a Member

WebPerf What is this probability="1.0" ?

Discussion in 'Web Development & Web Performance' started by rdan, Oct 8, 2019.

  1. rdan

    rdan Well-Known Member

    4,671
    1,121
    113
    May 25, 2014
    Ratings:
    +1,663
    Local Time:
    11:31 PM
    Mainline
    10.2
    That I see on
    Code:
    link rel="preconnect"
    ?
    Searching google doesn't return much info.
     
  2. eva2000

    eva2000 Administrator Staff Member

    41,725
    9,396
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,432
    Local Time:
    1:31 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    1.0 = 100% sure the link you want to preconnect will be called/requested. 0.5 = 50% sure etc etc
     
    • Informative Informative x 1
  3. rdan

    rdan Well-Known Member

    4,671
    1,121
    113
    May 25, 2014
    Ratings:
    +1,663
    Local Time:
    11:31 PM
    Mainline
    10.2
    Thanks a lot Eva!
     
  4. rdan

    rdan Well-Known Member

    4,671
    1,121
    113
    May 25, 2014
    Ratings:
    +1,663
    Local Time:
    11:31 PM
    Mainline
    10.2
    But rel preconnect isn't possible to configure as nginx header right?
     
  5. rdan

    rdan Well-Known Member

    4,671
    1,121
    113
    May 25, 2014
    Ratings:
    +1,663
    Local Time:
    11:31 PM
    Mainline
    10.2
    Or this will just work fine:
    Code:
    add_header Link <https://fonts.gstatic.com>; rel=preconnect; probability=1.0;
    
     
  6. eva2000

    eva2000 Administrator Staff Member

    41,725
    9,396
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,432
    Local Time:
    1:31 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Yeah preconnect like preload hints can be added via Nginx add_header too. Just you probably don't need probability=1.0 if you 100% know the request will be made every page load and need to wrap the Link values in single or double quotes i.e.
    Code (Text):
    add_header Link '<https://fonts.gstatic.com>; rel=preconnect; crossorigin; probability=1.0;';
    

    or
    Code (Text):
    add_header Link '<https://fonts.gstatic.com>; rel=preconnect; crossorigin;';
    
     
    • Informative Informative x 1