lush() 在 Firefox 4 中不起作用

发布于 2024-10-03 15:55:12 字数 580 浏览 0 评论 0原文

我注意到phpflush();在 Firefox 4 beta 7 中不起作用,因为它在 3.6.12 中起作用。

我最近安装了firefox 4 beta 7,当调用flush()时,内容没有立即刷新。它曾经在 3.6.12 中运行良好。还有什么东西可以为我提供冲洗功能吗?

我已经尝试过

flush();  
@ob_flush();

,我还尝试了页面顶部的以下代码。

@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0);
@ini_set('implicit_flush', 1);
for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
   ob_implicit_flush(1);

顺便说一下,我在 XAMPP/Apache 上使用 php。谢谢。


我发现将内容类型设置为 text/plain 是可行的,但它只输出纯文本而不是 html 内容。

I noticed that the php flush(); doesn't work in Firefox 4 beta 7, as it works in 3.6.12.

I recently installed firefox 4 beta 7, and the contents are not being flush immediately when flush() is called. It used to work fine in 3.6.12. Is there any thing else that could provide me with the flushing functionality.

I've tried

flush();  
@ob_flush();

I also tried the following code at the top of the page.

@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0);
@ini_set('implicit_flush', 1);
for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
   ob_implicit_flush(1);

By the way, I use php on XAMPP/Apache. Thanks.


I found that setting content type to text/plain works, but it just outputs plain text and not html content.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

过度放纵 2024-10-10 15:55:12

你看到的不是鬼魂 - 我也经历过 FF3.6 和 FF4 之间的相同差异。

这是一个解决方法:

echo str_repeat(" ", 1024);

在需要刷新的输出之前添加一个。例如,您可以将其放在 中。

我的理论是,FF4 就像 IE 和 Safari 一样,有一个小缓冲区,需要在增量渲染开始之前填充。

You're not seeing ghosts - I've experienced the same difference between FF3.6 and FF4.

Here's a work around: add an

echo str_repeat(" ", 1024);

before the output that needs to be flushed. You can put it for example in the <head>.

My theory is that FF4, like apparently IE and Safari, have a small buffer that needs to be filled before incremental rendering kicks in.

歌枕肩 2024-10-10 15:55:12

无论浏览器如何,flush 在服务器端的功能都是相同的。如果客户端显示的内容不同,那么您可以在服务器端做很多事情来修复它。

flush will function identically server-side regardless of the browser. If the client is displaying things differently, there's not a lot you can do server-side to fix it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文