开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜