Load all CSS and JavaScript in the footer




Wordpress LScache Plugin: Load all CSS and JavaScript in the footer

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi, Is there any way to load all JavaScript and CSS in the footer of a webpage using LiteSpeed? I have moved the stylesheets like font awesome and a couple of JavaScript libraries to footer.php in my theme. However, the optimized page still loads these scripts in the header. To do that, you have to hook to filter litespeed_buffer_after (Since v3.2.3.2+) and parse the JS/CSS, move them to footer. Thanks @hailite Could you please point me to some documentation about this hook? I tried searching on Google but couldnt find anything. I also read somewhere that LiteSpeed is working on a lighter version of the crawler that can be run by website owners. I had a suggestion for that. May be it could just crawl the most popular 50 or 100 pages of the website on a regular basis. This will prevent the server from getting overloaded and still serve a lot of visitors. Its new added. The doc will be ready soon and we will update here again for the link. For now you can check https://github.com/litespeedtech/lscache_wp/pull/243. It is a good example. The buffer modification hooks have been added to the API documentation. Also, there are lots of settings to customize & limit how the crawler runs.



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



Reference