• Resolved deewinc

    (@deewinc)


    Hello,

    Thanks to the developer for such a great plugin. I have managed to accelerate Google font loading time using this tool. However, I’m not sure on the MIME type to select when it comes to images, CSS, and JavaScript.

    Which one do you suggest we use? I have tried to select a random MIME type for PNG images and it seems not to work.

    Regards

    • This topic was modified 5 years, 3 months ago by deewinc.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Sam Perrow

    (@samperrow)

    @deewinc What type of hints are you adding? No need to randomly select a MIME type- the plugin will automatically figure that out for you. If you’re adding a JS script, it looks for the “.js” filename and adds the “script” attribute to the “as” MIME type, and so on for other file types.
    Images should be of the MIME type “image”, CSS should be “style”. If you aren’t sure which MIME type to use, I would just leave that option blank.

    Thread Starter deewinc

    (@deewinc)

    Hello

    That surely works.

    The only challenge is in determining the “AS” attribute as the plugin doesn’t allow you to leave it blank.

    Despite preload working for fonts, the following issues show up

    (link for resource) was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.

    Is that an error or it’s okay? I notice a slight delay in loading of the fonts styling due to the above reason.

    • This reply was modified 5 years, 3 months ago by deewinc.
    • This reply was modified 5 years, 3 months ago by deewinc.
    Plugin Author Sam Perrow

    (@samperrow)

    @deewinc The plugin should be allowing you to leave the “as” attribute blank, but there is the automatic MIME type determination. It is better to have it filled with the appropriate MIME type, but it usually isn’t critical.

    And if you get that notice in the console, that basically means that the page didn’t really need to preload that specific resource- so you can remove that preload hint.

    Thread Starter deewinc

    (@deewinc)

    Actually, it’s telling me that it’s a must to select “AS” attribute. The MIME type leaving it blank works but not without selecting AS attribute.

    Plugin Author Sam Perrow

    (@samperrow)

    @deewinc what is the resource URL you are using? The as attribute is mandatory for preload hints only.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Preload images, CSS, and JavaScript help’ is closed to new replies.