dta43039 2017-09-13 10:17
浏览 85
已采纳

php Symfony 3 ajax调用不是异步

I am using php Symfony 3 on my site and when I try to make a long ajax request, it blocks my site from operation with my browser. It means that I even cannot retrieve a page from another browser tab until request is done. On another server, which is written on pure php there is no such issue (I can open another page from my site when ajax call is pending). I thought this would be a mod_rewrite issue, but dont know how to check it. Are there any ideas how to fix it? Thank you.

UPD_1 I came across THIS question and now if the issue is with session file lock, how it could be fixed in Symfony 3 environment? Thank you

  • 写回答

1条回答 默认 最新

  • dongshao8125 2017-09-13 10:42
    关注

    Close your session in your controller.

    public function yourAjaxAction() {
        $this->get("session")->save();
        ...
    }
    

    This will make your session readonly and you will be able to do another requests. Only do that on the requests that does not need to update your session.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

悬赏问题

  • ¥20 西门子博图v16安装密钥提示CryptAcquireContext MS_DEF_PROV Error of containger opening
  • ¥15 mes系统扫码追溯功能
  • ¥40 selenium访问信用中国
  • ¥20 在搭建fabric网络过程中遇到“无法使用新的生命周期”的报错
  • ¥15 Python中关于代码运行报错的问题
  • ¥500 python 的API,有酬谢
  • ¥15 软件冲突问题,软件残留问题
  • ¥30 有没有人会写hLDA,有偿求写,我有一个文档,想通过hLDA得出这个文档的层次主题,有偿有偿!
  • ¥50 有没有人会写hLDA,有偿求写,我有一个文档,想通过hLDA得出这个文档的层次主题,有偿有偿!
  • ¥15 alpha101因子里哪些适合crypto?
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部