preload

Опубликовано Ksenia-Polo - ср, 05/29/2019 - 01:07

в файле html.tpl.php

https://drupal.ru/node/139675

Пример

Link: </resources/fonts/myfont.woff>; rel=preload; as=font; crossorigin

Link: </resources/css/something.css>; rel=preload; as=style

Link: </resources/js/main.js>; rel=preload; as=script

https://habr.com/ru/post/421059/

<link rel="preload" href="styles.css" as="style">  

<link rel="preload" href="ui.js" as="script">

https://developer.mozilla.org/ru/docs/Web/HTML/Preloading_content

<head> <meta charset="utf-8"> <title>Responsive preload example</title> <link rel="preload" href="bg-image-narrow.png" as="image" media="(max-width: 600px)"> <link rel="preload" href="bg-image-wide.png" as="image" media="(min-width: 601px)"> <link rel="stylesheet" href="main.css"> </head>

https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content

пример 

<link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/layout.css" as="style"> <link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/style.css" as="style"> <link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/colors.css" as="style"> stylesheets[print][] = css/print.css" as="style"> <link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/nice_menus.css" as="style"> <link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/nice_menus_default.css" as="style"> <link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/book.css" as="style"> <link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/my_style.css" as="style"> <link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/my_colors.css" as="style"> <link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/my_nice_menus_default.css" as="style"> <link rel="preload" href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/my_book.css" as="style">

href="https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/Calibri.woff" as="font">

Ошибки

The resource <URL> 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.

The resource https://tablica-umnozheniya.ru/sites/all/themes/myresponsivebartik/css/book.css 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.