Does LessCSS cause load lag on pages?
With LessCSS requiring the execution of JS before it'开发者_JS百科s able to load the page, is it a good idea to even use this library on a site that relies on heavy traffic? It seems like it's a bad idea cause of the initial parsing time of JS being executed, like the CSS wouldn't display properly until the JS file has downloaded...
You don't have to use LessCSS from the client side (JavaScript) - there is also a server-side script, which can even be invoked by command line.
If your site gets heavy traffic, this would be the recommended route, since the script only runs once every time the CSS is changed.
I won't use Less unless I can parse it on the backend - for exactly the reasons you're citing. Using the JS library basically creates a big flash of unstyled content. If it's an option, use a Less parser with whatever backend technology your site implements.
Yes, client-side adds lag Server side also adds lag, but it is miniscule.
The fastest way would be to compile your LESS into regular CSS and use the compiled version instead. A build script will help make that less tedious
精彩评论