Zend框架 - 同一个浏览器打开多个标签页,而是要等待第一个请求到成品 [英] Zend Framework - Same browser open multiple tabs but wait for first request to finished

查看:175
本文介绍了Zend框架 - 同一个浏览器打开多个标签页,而是要等待第一个请求到成品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有相同的浏览器客户端的问题尝试打开多个标签吧。但我的服务器是等待第一个请求到成品。

I have issue with same browser client try to open multiple tabs with it. but my server is wait for first request to finished.

例如:


  1. 这需要更多的像30秒的时间打开一个浏览器选项卡。

  1. Open first browser tab that take more time like 30sec.

现在,下一个选项卡与CTR +鼠标的帮助下打开点击鲍泽开放新标签,这只是静态页面1秒的等待;但STIL我必须等待完成第一个请求。

Now, next tab open with the help of CTR + Mouse click open new tab in bowser that is just static page 1 sec wait; but stil i have to wait for first request to finished.

请注意:我的网站在不活,但我使用下列技术
PHP 5.4中,MySQL,Zend框架2.1,Xampp时1.8

Note : I have website in not in live but i am using following technology PHP 5.4, Mysql, Zend Framework 2.1, Xampp 1.8

请在上述问题引导如果confution你可以对其进行评论。我很乐意做的聊天也。

Please guide in above issue if an confution you can comment on it. I am happy to do chat also.

推荐答案

我猜你有在session_start()每一页上。

默认PHP会话是基于文件。因此,每当在session_start()被称为会发生服务器上的文件锁。直到完成的过程中文件锁定不会被释放。

Default PHP session is based on files. Hence whenever the session_start() is called the file lock will occur on the server. Until complete the process the file lock won't be released.

要解决此问题,使用 session_write_close()您的网页上。密切有效地利用本次会议的写入。一旦你写的一切都变成了会话然后将其关闭。

To resolve this problem use session_write_close() on your page. Use this session write close efficiently. Once you written everything into the session then close it.

session_write_close()将释放锁。后 session_write_close()你可以阅读从会话中的数据,但你不能写。如果你想将它写,那么你需要再次重新启动会话中使用在session_start()

session_write_close() will release the lock. After session_write_close() you can read the data from session but you can't write it. If you want to write it then you need to restart the session again using session_start().

在你的脚本没有终止会话数据通常存储
  需要调用session_write_close(),但作为会话数据被锁定
  以prevent并发写入只有一个脚本可能在一个会话操作
  在任何时候。当使用框架与会话一起你会
  经历装载逐个帧由于该锁定。您可以
  通过结束会话减少加载所有帧所需的时间
  一旦到会话变量所有的改变都完成。

Session data is usually stored after your script terminated without the need to call session_write_close(), but as session data is locked to prevent concurrent writes only one script may operate on a session at any time. When using framesets together with sessions you will experience the frames loading one by one due to this locking. You can reduce the time needed to load all the frames by ending the session as soon as all changes to session variables are done.

编号:

http://www.php.net//手动/ EN / function.session-写close.php
http://www.php.net/manual/en/function.session -start.php

这篇关于Zend框架 - 同一个浏览器打开多个标签页,而是要等待第一个请求到成品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆