javascript - Browser drops POST when Apache KeepAlive is on -


for many years have had apache keep-alive turned on performance reasons. allows connections reused , makes pages load subtly faster. however, in last several months strange issue has started happen.

sometimes, connection user's browser application gets dropped causes data not saved , error presented. have done considerable amount of testing , think have narrowed problem down. doesn't matter browser use. database , server side scripting not factor. happens posts not gets interesting. goes away if disable keep-alive.

here think happening. have keepalivetimeout set 1 second. after 1 second, server terminates connection takes short amount of time (lets 100ms) client realize terminated. so, between 1 second , 1.1 seconds, if client attempts reuse connection , post data, post fail. i've reproduced making script posts data @ 1 second intervals, , can see every other connection client getting dropped. if change script post @ 0.9 second intervals or 1.1 second intervals never drops connection because specific timing window avoided. if change keepalivetimeout 2 seconds or other number, pushes out timing window , doesn't solve problem.

my posts coming javascript (jquery.ajax), imagine happen regular form post if got timing right.

in safari , ie, connection gets dropped , fails. in firefox , chrome browser stalls dozens of seconds , re-sends request on new connection succeeds.

if fundamental problem keepalive confusing me why worked years , started doing in last few months. temporarily, have disabled keep-alive, find way use if possible. , hoping here knows of solution.


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -