且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从API获取数据时的客户端与服务器端

更新时间:2023-09-12 11:34:22

这样做是否有***实践?

Is there a best practice in doing this?

不是一般人

一种选择是否比另一种更快?

Is one option faster than the other?

在服务器端执行此操作可以将结果缓存并在多个客户端之间共享.这可能会更快.

Doing it server side allows results to be cached and shared between multiple clients. This might be faster.

在服务器端执行此操作可使客户端减少一个HTTP请求.这可能会更快.

Doing it server side allows the client to make one fewer HTTP requests. This might be faster.

在客户端执行此操作可以重做它,而无需重新加载整个页面.这可能会更快.

Doing it client side allows it to be redone without reloading the whole page. This might be faster.

在客户端进行操作意味着它来自另一台计算机,该计算机可能与发出请求的服务器更近或更远.这可能会更快.

Doing it client side means it comes from a different computer which might be nearer or further from the server the request is being made to. This might be faster.