S******1 发帖数: 216 | 1 【 以下文字转载自 Programming 讨论区 】
发信人: Snail121 (二爷粉丝团), 信区: Programming
标 题: Web Service怎么让多个api call share 同一个 connection ??
发信站: BBS 未名空间站 (Sun Aug 3 15:25:49 2014, 美东)
有一个关于apache keep alive 的问题。
如果有一个web server是用apache host的,设置了keep alive为true, 那是不是默认
对于同一个client的multiple api call (even different types of api to the same
web service) 都是share同一个connection, 除了设置外,在程序上如何实现这点呢(
比如用java servlet) ??
还有就是keep alive 是share persistent connection的, 也就是对于同一个client
不会多次创建http连接,那么这里的client是怎么定义的,是一个什么样的scope ? 比
如一个apache website 用了keep alive, 哪一个用户的browser开了多个tab也是同样
share一个连接吗,怎么identify的,原理是什么呢??????? | s******e 发帖数: 493 | 2 Depending on the types of web servers, your keep alive might be honoured. If
it is honoured, from server side, it will only mean it will not terminate
the connection right after each request. It is still up to your client (
browser and javascript code/js framework) to reuse it. It is a quite
complicated topic, google is your best friend. Also you may want to search
long pooling, http streaming and websocket to dig deeper. |
|