Long polling locking up other AJAX calls

前端 未结 3 1164
滥情空心
滥情空心 2020-12-06 03:42

I\'m looking to do long polling to \"push\" some data down to the client and I\'m also making other unrelated AJAX calls to the server in parallel with the long polling. It

相关标签:
3条回答
  • 2020-12-06 03:48

    it works for symfony 1.4. user session_write_close(); instead of $this->getUser()->shutdown();

    0 讨论(0)
  • 2020-12-06 03:50

    This happens because of session file locks. In CakePHP you can choose other options for session management. You can save sessions in database, in cache etc. So you don't wait for file lock issues.

    The built-in configurations are:

    php - Saves sessions with the standard settings in your php.ini file.

    cake - Saves sessions as files inside app/tmp/sessions. This is a good option when on hosts that don’t allow you to write outside your own home dir.

    database - Use the built-in database sessions.

    cache - Use the built-in cache sessions.

    http://book.cakephp.org/2.0/en/development/sessions.html#built-in-session-handlers-configuration

    Of course you can make session_write_close(), but you should be sure that no changes needed in session between two page loads.

    Similar question: Simultaneous Requests to PHP Script

    0 讨论(0)
  • 2020-12-06 03:56

    Seems like you experienced the session file lock.

    Perform session_write_close() (or corresponding function in cakephp) to close the session in the begin of the ajax endpoint.

    0 讨论(0)
提交回复
热议问题