Use preload for fonts




Wordpress LScache Plugin: Use preload for fonts

Last Updated on: Wed, 15 Apr 2026 00:00:02
how can I add for fonts? Google pagespeed said I need to fix it There is a plugin called Pre Party which will let you Pre load it. But if you need to host your fonts locally and preload it try OMGF plugin. The free version itself is enough. @adaaasdsfe what is that link? @ormonk Why I need other plugin for this? I dont think LSCache lets you preload. Preloading of static sources like fonts,css, js, image is good, but it is no good idea to use html preload. This tag loads sources too late and doesnt have any advantage. LiteSpeed webserver supports Server/PUSH feature that makes preloading in response header available. This kind of preloading is much faster and loads sources before any data for response body is loaded. To prevent preloading on every page request LiteSpeed webserver recognize if there is a preload header. If preload header exists LSWS sets cookie ls_smartpush automatically and if this cookie is set preloading sources will only be loaded once and not with each page request. Static sources must not be preloaded with each page request because they are already in browser cache with the first request. Preload header can be set with PHP or in .htaccess Example for .htaccess: RewriteCond % HTTP_COOKIE !ls_smartpush [NC] RewriteRule ^. $ - [ENV=PRELOAD:true] Header add Link rel=preload as=font crossorigin=anonymous, rel=preload as=style, rel=preload as=script env=PRELOAD Take care of different usage for tags depending on kind of static source: Fonts: rel=preload as=font crossorigin=anonymous CSS: rel=preload as=style Javascript: rel=preload as=script Images: rel=preload as=image Enjoy! Dont use any plugin for HTML preload! Have a look at Asset Clean Up, they have an option to preload Google fonts as well as help to speed up the loading of JS and CSS files away from what a cache plugin can do Ive started using it alongside Litespeed and its helped massively Hi, Font preload is on our to-do plan Best regards, @mattthomas-photography Thanks, but I dont want to add plugins @CacheCrawler Great, hope it will be soon @mstudioil You dont have to wait for an plugin update. The way I described is the same way WP cache plugin will do it in upcoming versions. It will also use server/PUSH feature from LiteSpeed webserver to preload static sources. This how to can be used not only for fonts. You can use it vor every static source. @CacheCrawler Thanks, will this remove and fix what Google pagespeed said? I need to add line for every font makes the problems? I need to add line for every font makes the problems? No, only 1 header for all fonts, css or whatever like in the example above. This is special and needed to respect ls_smartpush cookie. FYI: Pagespeed doesnt support server/PUSH preload. Thanks



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference