Viewing 8 replies - 16 through 23 (of 23 total)
  • This depends on the theme and plugins you have installed.

    Thread Starter freddyee

    (@freddyee)

    How to pre load the fonts from the plugin ?

    Thread Starter freddyee

    (@freddyee)

    How to preload the fonts and local fonts also ? because I keep having that problem

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    you can add

    Header add Link "</path/to/your/font.woff>; rel=preload;"

    or

    Header add Link "<https://other-domain.com/path/to/your/font.woff>; rel=preload;"

    into .htaccess

    purge all

    Best regards,

    Good idea, but not the very best. Preloading static sources if they are already cached by browser doesn’t reduce data load. The better method would be

    RewriteCond %{HTTP_COOKIE} !ls_smartpush [NC]
    RewriteRule ^.*$ - [ENV=PRELOAD:true]
    Header add Link "</path/to/your/font.woff>; rel=preload;as=font;crossorigin=anonymous" env=PRELOAD

    Notice: Server PUSH is not supported by Apple Safari browser.

    Thread Starter freddyee

    (@freddyee)

    According to what you said, I end with this:

    RewriteCond %{HTTP_COOKIE} !ls_smartpush [NC]
    RewriteRule ^.*$ - [ENV=PRELOAD:true]
    Header add Link "</wp-content/plugins/elementor/assets/lib/font-awesome/webfonts/fa-brands-400.woff2>; rel=preload;as=font;crossorigin=anonymous" env=PRELOAD
    Header add Link "</wp-content/plugins/elementor/assets/lib/font-awesome/webfonts/fa-solid-900.woff2>; rel=preload;as=font;crossorigin=anonymous" env=PRELOAD
    Header add Link "</wp-content/uploads/sgf-css/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2>; rel=preload;as=font;crossorigin=anonymous" env=PRELOAD
    Header add Link "</wp-content/uploads/sgf-css/JTUPjIg1_i6t8kCHKm459WxZcgvz_PZwjimrqw.woff2>; rel=preload;as=font;crossorigin=anonymous" env=PRELOAD
    Header add Link "</wp-content/uploads/sgf-css/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2>; rel=preload;as=font;crossorigin=anonymous" env=PRELOAD
    Header add Link "</wp-content/themes/oceanwp/assets/fonts/simple-line-icons/Simple-Line-Icons.woff2?v=2.4.0>; rel=preload;as=font;crossorigin=anonymous" env=PRELOAD
    Header add Link "</wp-content/uploads/sgf-css/KFOlCnqEu92Fr1MmWUlfBBc4AMP6lQ.woff2>; rel=preload;as=font;crossorigin=anonymous" env=PRELOAD

    Is that correct ?

    Add only 1 header, combine all header to 1 and seperate each preload source with comma

    RewriteCond %{HTTP_COOKIE} !ls_smartpush [NC]
    RewriteRule ^.*$ - [ENV=PRELOAD:true]
    Header add Link "</wp-content/plugins/elementor/assets/lib/font-awesome/webfonts/fa-brands-400.woff2>; rel=preload;as=font;crossorigin=anonymous,</wp-content/uploads/sgf-css/mem8YaGs126MiZpBA-UFVZ0bf8pkAg.woff2>; rel=preload;as=font;crossorigin=anonymous" env=PRELOAD

    Notice:
    1.) This way to preload static sources in .htaccess will only work if filename will not be changed.
    2.) Preload by using server PUSH must be enabled. You can verify it if you check if ls_smartpush cookie is set by LSWS.
    3.) Apple Safari browser doesn’t support this way to preload. That’s why LSWS doesn’t set ls_smartpush cookie if user agent is Apple Safari device related.

    • This reply was modified 4 years, 2 months ago by serpentdriver.

    And also notice: You already have a huge number of preloads defined in your theme. They come from installed plugins. If you add more preloads nothing will be better! Disable or better remove all plugins you don’t really need. This is the best way to improve page speed and it is for free!

Viewing 8 replies - 16 through 23 (of 23 total)
  • The topic ‘reder-blocking resources’ is closed to new replies.