我正在使用XAMPP和websockets在Android中构建聊天应用程序。发送组消息后,该消息将显示在数据库和所有其他组成员屏幕中。但是,在Apache access.log中查看,有一个GET /请求,然后是数百个POST /操作,从而查看用户移动屏幕,然后显示数百次相同的消息。
对此有补救措施吗?可以在Apache中更改的设置,以防止循环?
来自Apache access.log的示例
127.0.0.1 - - [02/Aug/2014:12:47:48 -0400] "GET /server-status HTTP/1.1" 200 4655 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36"
- - [02/Aug/2014:12:47:57 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"
- - [02/Aug/2014:12:47:57 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"
- - [02/Aug/2014:12:47:57 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"
- - [02/Aug/2014:12:47:57 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"
- - [02/Aug/2014:12:48:12 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"
- - [02/Aug/2014:12:48:12 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"
- - [02/Aug/2014:12:48:12 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"
- - [02/Aug/2014:12:48:12 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"
- - [02/Aug/2014:12:48:27 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"
- - [02/Aug/2014:12:48:27 -0400] "POST /AndroidChatterDatabase/ HTTP/1.1" 200 321 "-" "Dalvik/1.6.0 (Linux; U; Android 4.0.3; SGH-T989 Build/IML74K)"