<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>197010</bug_id>
          
          <creation_ts>2019-04-17 07:18:07 -0700</creation_ts>
          <short_desc>Safari doesn&apos;t preconnect to origin when using rel=&quot;preconnect dns-prefetch&quot;</short_desc>
          <delta_ts>2026-03-30 01:01:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andy Davies">ad</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ad</cc>
    
    <cc>ap</cc>
    
    <cc>beidson</cc>
    
    <cc>cdumez</cc>
    
    <cc>dmdabbs</cc>
    
    <cc>koivisto</cc>
    
    <cc>paulirish</cc>
    
    <cc>rik</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>yoav</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1528082</commentid>
    <comment_count>0</comment_count>
      <attachid>367623</attachid>
    <who name="Andy Davies">ad</who>
    <bug_when>2019-04-17 07:18:07 -0700</bug_when>
    <thetext>Created attachment 367623
Test page with preconnect and dns-prefetch

Safari doesn&apos;t preconnect to an origin if both the preconnect and dns-prefetch hints are included in the same rel attribute e.g.

&lt;link rel=&quot;preconnect dns-prefetch&quot; href=&quot;https://www.wikipedia.org/&quot;&gt;

I&apos;ve used this pattern in the past as a graceful degradation for browsers that didn&apos;t support preconnect


Tests both using WebPageTest and Safari Inspector using the two attached pages - when the preconnect is successfully made a message appears in the Inspector Console

Work around is to specify the resource hints separately</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528083</commentid>
    <comment_count>1</comment_count>
      <attachid>367624</attachid>
    <who name="Andy Davies">ad</who>
    <bug_when>2019-04-17 07:18:45 -0700</bug_when>
    <thetext>Created attachment 367624
Test page with just preconnect resource hint</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528089</commentid>
    <comment_count>2</comment_count>
    <who name="Andy Davies">ad</who>
    <bug_when>2019-04-17 07:32:46 -0700</bug_when>
    <thetext>Should have also mentioned that this pattern works in Chrome</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528485</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2019-04-18 09:54:42 -0700</bug_when>
    <thetext>Looking at the code, it looks like we don&apos;t support multiple values in &quot;rel&quot; at all.

We do seem to support multiple rel attributes though. Andy, can you try &apos;rel=&quot;preconnect&quot; rel=&quot;dns-prefetch&quot;&apos;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528486</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2019-04-18 09:54:59 -0700</bug_when>
    <thetext>&lt;rdar://problem/50018906&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528557</commentid>
    <comment_count>5</comment_count>
      <attachid>367746</attachid>
    <who name="Andy Davies">ad</who>
    <bug_when>2019-04-18 13:44:33 -0700</bug_when>
    <thetext>Created attachment 367746
Single link element with rel=preconnect and then rel=dns-prefetch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528561</commentid>
    <comment_count>6</comment_count>
      <attachid>367747</attachid>
    <who name="Andy Davies">ad</who>
    <bug_when>2019-04-18 13:45:15 -0700</bug_when>
    <thetext>Created attachment 367747
Single link element with rel=dns-prefetch and then rel=preconnect</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1528568</commentid>
    <comment_count>7</comment_count>
    <who name="Andy Davies">ad</who>
    <bug_when>2019-04-18 13:51:17 -0700</bug_when>
    <thetext>Two new test pages attached where the link element has multiple rel attributes

&lt;link rel=&quot;dns-prefetch&quot; rel=&quot;preconnect&quot; href=&quot;https://www.wikipedia.org/&quot;&gt;
&lt;link rel=&quot;preconnect&quot; rel=&quot;dns-prefetch&quot; href=&quot;https://www.wikipedia.org/&quot;&gt;

In the case where the preconnect rel attribute comes first then Safari preconnects - get message in the console to indicate it, and the WebPageTest waterfall is missing the connection setup (which is normal for Safari when it preconnects)

dns-prefetch then preconnect - https://www.webpagetest.org/result/190418_WQ_58c2423b8532c6e12e73677b22a2cffe/

preconnect then dns-prefetch https://www.webpagetest.org/result/190418_15_a09ce74e9616ee5555cc5faaba33cb3c/

For comparison Chrome preconnects in both test cases (preconnect in Firefox appears broken ATM)

https://www.webpagetest.org/result/190418_8B_09a0743914357f1ada40740a43065085/
https://www.webpagetest.org/result/190418_XT_62b65003d8ea2a6db70a110aaa84e51f/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1556192</commentid>
    <comment_count>8</comment_count>
    <who name="">dmdabbs</who>
    <bug_when>2019-07-26 11:58:20 -0700</bug_when>
    <thetext>Resource Hints can also be signaled by HTTP headers with multiple rel types. Is that properly supported as well?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>367623</attachid>
            <date>2019-04-17 07:18:07 -0700</date>
            <delta_ts>2019-04-17 07:18:07 -0700</delta_ts>
            <desc>Test page with preconnect and dns-prefetch</desc>
            <filename>preconnect-and-dns-prefetch.html</filename>
            <type>text/html</type>
            <size>693</size>
            <attacher name="Andy Davies">ad</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogICAgPGhlYWQ+CiAgICAgICAgPG1ldGEgY2hhcnNldD0i
VVRGLTgiPgogICAgICAgIDx0aXRsZT5yZWw9cHJlY29ubmVjdCAmIGRucy1wcmVmZXRjaCBkZW1v
PC90aXRsZT4KICAgICAgICA8bGluayByZWw9InByZWNvbm5lY3QgZG5zLXByZWZldGNoIiBocmVm
PSJodHRwczovL3d3dy53aWtpcGVkaWEub3JnLyI+CiAgICAgICAgPHN0eWxlPgogICAgICAgICAg
ICBpbWcgewogICAgICAgICAgICAgICAgd2lkdGg6IDI1MHB4OwogICAgICAgICAgICAgICAgaGVp
Z2h0OiAyNTBweAogICAgICAgICAgICB9CiAgICAgICAgPC9zdHlsZT4KICA8L2hlYWQ+CiAgPGJv
ZHk+CiAgICAgICAgPCEtLSBsYXJnZSBzY3JpcHQgdG8gYmxvY2sgcGFyc2VyIC0tPgogICAgICAg
IDxzY3JpcHQgc3JjPSJqcy9sYXJnZS1zY3JpcHQuanMiPjwvc2NyaXB0PgoKICAgICAgICA8IS0t
IGRvYy53cml0ZSBpbiBpbWFnZXMsIGRvbid0IGRvIHRoaXMgYXQgaG9tZSBmb2xrcyEhISAtLT4K
ICAgICAgICA8c2NyaXB0PgogICAgICAgICAgICBkb2N1bWVudC53cml0ZSgnPGltZyBzcmM9Imh0
dHBzOi8vd3d3Lndpa2lwZWRpYS5vcmcvcG9ydGFsL3dpa2lwZWRpYS5vcmcvYXNzZXRzL2ltZy9X
aWtpcGVkaWEtbG9nby12MkAyeC5wbmciIC8+Jyk7CiAgICAgICAgPC9zY3JpcHQ+CiAgPC9ib2R5
Pgo8L2h0bWw+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>367624</attachid>
            <date>2019-04-17 07:18:45 -0700</date>
            <delta_ts>2019-04-17 07:18:45 -0700</delta_ts>
            <desc>Test page with just preconnect resource hint</desc>
            <filename>preconnect.html</filename>
            <type>text/html</type>
            <size>665</size>
            <attacher name="Andy Davies">ad</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogICAgPGhlYWQ+CiAgICAgICAgPG1ldGEgY2hhcnNldD0i
VVRGLTgiPgogICAgICAgIDx0aXRsZT5yZWw9cHJlY29ubmVjdCBkZW1vPC90aXRsZT4KICAgICAg
ICA8bGluayByZWw9InByZWNvbm5lY3QiIGhyZWY9Imh0dHBzOi8vd3d3Lndpa2lwZWRpYS5vcmcv
Ij4KICAgICAgICA8c3R5bGU+CiAgICAgICAgICAgIGltZyB7CiAgICAgICAgICAgICAgICB3aWR0
aDogMjUwcHg7CiAgICAgICAgICAgICAgICBoZWlnaHQ6IDI1MHB4CiAgICAgICAgICAgIH0KICAg
ICAgICA8L3N0eWxlPgogIDwvaGVhZD4KICA8Ym9keT4KICAgICAgICA8IS0tIGxhcmdlIHNjcmlw
dCB0byBibG9jayBwYXJzZXIgLS0+CiAgICAgICAgPHNjcmlwdCBzcmM9ImpzL2xhcmdlLXNjcmlw
dC5qcyI+PC9zY3JpcHQ+CgogICAgICAgIDwhLS0gZG9jLndyaXRlIGluIGltYWdlcywgZG9uJ3Qg
ZG8gdGhpcyBhdCBob21lIGZvbGtzISEhIC0tPgogICAgICAgIDxzY3JpcHQ+CiAgICAgICAgICAg
IGRvY3VtZW50LndyaXRlKCc8aW1nIHNyYz0iaHR0cHM6Ly93d3cud2lraXBlZGlhLm9yZy9wb3J0
YWwvd2lraXBlZGlhLm9yZy9hc3NldHMvaW1nL1dpa2lwZWRpYS1sb2dvLXYyQDJ4LnBuZyIgLz4n
KTsKICAgICAgICA8L3NjcmlwdD4KICA8L2JvZHk+CjwvaHRtbD4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>367746</attachid>
            <date>2019-04-18 13:44:33 -0700</date>
            <delta_ts>2019-04-18 13:44:33 -0700</delta_ts>
            <desc>Single link element with rel=preconnect and then rel=dns-prefetch</desc>
            <filename>preconnect-and-dns-prefetch-seperate-rels.html</filename>
            <type>text/html</type>
            <size>699</size>
            <attacher name="Andy Davies">ad</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogICAgPGhlYWQ+CiAgICAgICAgPG1ldGEgY2hhcnNldD0i
VVRGLTgiPgogICAgICAgIDx0aXRsZT5yZWw9cHJlY29ubmVjdCAmIGRucy1wcmVmZXRjaCBkZW1v
PC90aXRsZT4KICAgICAgICA8bGluayByZWw9InByZWNvbm5lY3QiIHJlbD0iZG5zLXByZWZldGNo
IiBocmVmPSJodHRwczovL3d3dy53aWtpcGVkaWEub3JnLyI+CiAgICAgICAgPHN0eWxlPgogICAg
ICAgICAgICBpbWcgewogICAgICAgICAgICAgICAgd2lkdGg6IDI1MHB4OwogICAgICAgICAgICAg
ICAgaGVpZ2h0OiAyNTBweAogICAgICAgICAgICB9CiAgICAgICAgPC9zdHlsZT4KICA8L2hlYWQ+
CiAgPGJvZHk+CiAgICAgICAgPCEtLSBsYXJnZSBzY3JpcHQgdG8gYmxvY2sgcGFyc2VyIC0tPgog
ICAgICAgIDxzY3JpcHQgc3JjPSJqcy9sYXJnZS1zY3JpcHQuanMiPjwvc2NyaXB0PgoKICAgICAg
ICA8IS0tIGRvYy53cml0ZSBpbiBpbWFnZXMsIGRvbid0IGRvIHRoaXMgYXQgaG9tZSBmb2xrcyEh
ISAtLT4KICAgICAgICA8c2NyaXB0PgogICAgICAgICAgICBkb2N1bWVudC53cml0ZSgnPGltZyBz
cmM9Imh0dHBzOi8vd3d3Lndpa2lwZWRpYS5vcmcvcG9ydGFsL3dpa2lwZWRpYS5vcmcvYXNzZXRz
L2ltZy9XaWtpcGVkaWEtbG9nby12MkAyeC5wbmciIC8+Jyk7CiAgICAgICAgPC9zY3JpcHQ+CiAg
PC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>367747</attachid>
            <date>2019-04-18 13:45:15 -0700</date>
            <delta_ts>2019-04-18 13:45:15 -0700</delta_ts>
            <desc>Single link element with rel=dns-prefetch and then rel=preconnect</desc>
            <filename>dns-prefetch-and-preconnect-separate-rels.html</filename>
            <type>text/html</type>
            <size>699</size>
            <attacher name="Andy Davies">ad</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgogICAgPGhlYWQ+CiAgICAgICAgPG1ldGEgY2hhcnNldD0i
VVRGLTgiPgogICAgICAgIDx0aXRsZT5yZWw9cHJlY29ubmVjdCAmIGRucy1wcmVmZXRjaCBkZW1v
PC90aXRsZT4KICAgICAgICA8bGluayByZWw9ImRucy1wcmVmZXRjaCIgcmVsPSJwcmVjb25uZWN0
IiBocmVmPSJodHRwczovL3d3dy53aWtpcGVkaWEub3JnLyI+CiAgICAgICAgPHN0eWxlPgogICAg
ICAgICAgICBpbWcgewogICAgICAgICAgICAgICAgd2lkdGg6IDI1MHB4OwogICAgICAgICAgICAg
ICAgaGVpZ2h0OiAyNTBweAogICAgICAgICAgICB9CiAgICAgICAgPC9zdHlsZT4KICA8L2hlYWQ+
CiAgPGJvZHk+CiAgICAgICAgPCEtLSBsYXJnZSBzY3JpcHQgdG8gYmxvY2sgcGFyc2VyIC0tPgog
ICAgICAgIDxzY3JpcHQgc3JjPSJqcy9sYXJnZS1zY3JpcHQuanMiPjwvc2NyaXB0PgoKICAgICAg
ICA8IS0tIGRvYy53cml0ZSBpbiBpbWFnZXMsIGRvbid0IGRvIHRoaXMgYXQgaG9tZSBmb2xrcyEh
ISAtLT4KICAgICAgICA8c2NyaXB0PgogICAgICAgICAgICBkb2N1bWVudC53cml0ZSgnPGltZyBz
cmM9Imh0dHBzOi8vd3d3Lndpa2lwZWRpYS5vcmcvcG9ydGFsL3dpa2lwZWRpYS5vcmcvYXNzZXRz
L2ltZy9XaWtpcGVkaWEtbG9nby12MkAyeC5wbmciIC8+Jyk7CiAgICAgICAgPC9zY3JpcHQ+CiAg
PC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>