[wp-trac] [WordPress Trac] #37652: Protocol-relative preconnects are broken

WordPress Trac noreply at wordpress.org
Sat Aug 13 07:38:02 UTC 2016


#37652: Protocol-relative preconnects are broken
---------------------------+------------------------------
 Reporter:  neoxx          |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Script Loader  |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  performance
---------------------------+------------------------------

Comment (by neoxx):

 Sure thing, here you go:

 {{{#!php
 function wp_resource_hints($hints, $relation_type) {
         if ($relation_type=='preconnect') {
                 $hints[]='//example.org';
         }

         return $hints;
 }
 }}}

 Though, I currently use the following work-around:

 {{{#!php
 $protocol=(is_ssl()) ? 'https' : 'http';

 $hints[]=$protocol.'://example.org';
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37652#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list