Support » Plugin: Pre* Party Resource Hints » Manually editing entries

  • Resolved rom174

    (@rom174)


    Hello team,

    I would like to know how to manualy modify a line in the dashboard settings.
    I wonder it because Lighthouse is asking to add ‘crossorigin’ attribute to external domains :

    A preconnect <link> was found for “https://i.ytimg.com&#8221; but was not used by the browser. Check that you are using the crossorigin attribute properly.

    and also because Chrome is showing an alert advising to add an as value to the HTTP header preloaded links :

    <link rel=preload> must have a valid ‘as’ value

    In my HTTP headers, I have something like this but as you can see there is no crossorigin on every external sites and no as at all :

    <https://www.google-analytics.com>; rel=preconnect,
    <https://fonts.googleapis.com>; rel=preconnect; crossorigin,
    <https://connect.facebook.net>; rel=preconnect,
    <https://load.sumo.com>; rel=preconnect,
    <https://fonts.gstatic.com>; rel=preconnect; crossorigin,
    <https://www.googletagmanager.com>; rel=preconnect,
    <https://www.facebook.com>; rel=preconnect,
    <https://i.ytimg.com>; rel=preconnect,
    <https://sumo.com>; rel=preconnect,
    <https://graph.facebook.com>; rel=preconnect,
    <https://api.facebook.com>; rel=preconnect,
    <https://sumo.com>; rel=preload,
    <https://load.sumo.com>; rel=preload

    Let me know if it is possible to fix it and how ?

    • This topic was modified 11 months, 1 week ago by Jan Dembowski.
    • This topic was modified 11 months, 1 week ago by rom174.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sam Perrow

    (@samperrow)

    Greetings,
    For the ytimg.com preconnect in this situation, it looks like Lighthouse is giving you that warning because no resources were loaded from that domain on that particular page. Crossorigin attributes are typically only needed when preconnecting fonts. Could you send me your domain name so I can take a better look? You can find me on the WP slack channel.

    When using preload, you must specify a specific resource that is required on a page, like a CSS, JS, or image. That will allow the resource to be loaded and available sooner than it typically would. You have two domains sumo.com and load.sumo.com preloaded, which isn’t the right use case for the preload hint.

    I am working hard on an updated version that allows users to better control resource hint attributes. Stay tuned.
    Hope this helps, Sam

    Hello @samperrow
    Sorry for my delayed answer, you were so fast to reply, thank you for all these explanations.

    For the preload, thank you very much for pointing the mis-usage I did with it.

    For the crossorigin attribute, why is that only needed for the fonts ? Aren’t domains needed to be crossorigin no matter the purpose ? As well as jpg, css or js loaded are ressources from another domain to be loaded (from a browser point of view). Or is crossorigin only for final ressources not for domains ?

    If I understand your advice for an image, the domain of an image cannot be preconnected but only the image itself can be preloaded via its full path ?

    I have removed sumo domains to being preloaded (Should I have used dns-preconnect for this ?) For other ressources, is there a way to edit a single line in order to add the as attribute for a specific ressource ?

    Sorry and thank you for all of these questions and precisions.

    Plugin Author Sam Perrow

    (@samperrow)

    Read this article for more information about why crossorigin is needed for fonts: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.

    If you are going to preload an image, you can do so, but there wouldn’t be a need to preconnect it also. What I mean is that when using preload, you must specify an entire URL for that resource, but with all preconnect hints you only need to specify a domain name. The reason is due to the different nature of the two resource hints.

    I plan on releasing an updated version of the plugin which allows users to specify crossorigin, as, and the type attributes. Stay tuned!

    rom174

    (@rom174)

    Just read it, this is very interesting.
    These new features will be usefull !

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Manually editing entries’ is closed to new replies.