运行较少的服务器端与客户端
与服务器端相比,在客户端运行 LESS 框架有哪些优点/缺点?如果在客户端运行页面加载时间会受到影响吗?
What are the advantages / disadvantages to running the LESS framework client-side vs. server-side? Does page load time take a hit if you run it client-side?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在服务器上,您必须更加小心缓存控制标头,并且会牺牲一点 CPU 能力。
在客户端,如果 JS 不可用,它就会中断。
(对于您的生产系统)在构建时执行此操作并仅提供静态 CSS。这是高效且可靠的。
On the server, you have to take more care with your cache control headers and you sacrifice a bit of CPU power.
On the client, it breaks if JS isn't available.
(For your production systems,) do it at build time and just serve up static CSS. That's efficient and reliable.
使用 ASP.NET MVC 4.0 捆绑,您可以使用:
一切都将得到很好的处理。缓存、转换(服务器端)、捆绑和...
Using ASP.NET MVC 4.0 Bundling you can use:
Everything will be handled very nicely. Caching, Transforming (server-side), bundling and ...
客户端:
优点:
缺点:
中断 服务器端:
优点:
缺点:
我的建议:
永远不要在生产中使用客户端。然而,在开发过程中,编译较少的客户端可能非常有用。
Client-side:
Advantages:
Disadvantages:
Server-side:
Advantages:
Disadvantages:
My advise:
Never ever use client side in production. In development it may however be very useful to compile less client side.