K
K
Konstantin2020-05-17 11:18:41
1C-Bitrix
Konstantin, 2020-05-17 11:18:41

Why doesn't buffering work in Bitrix?

Buffering suddenly fell off on the site

Проблема возникает при подключении $_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php".
Конкретно в блоке

public static function PrologActions()
  {
    /** @global CMain $APPLICATION */
    global $APPLICATION, $USER;

    if(COption::GetOptionString("main", "buffer_content", "Y")=="Y" && (!defined("BX_BUFFER_USED") || BX_BUFFER_USED!==true))
    {
      ob_start(array(&$APPLICATION, "EndBufferContent"));
      $APPLICATION->buffered = true;
      define("BX_BUFFER_USED", true);

      register_shutdown_function(
        function()
        {
          define("BX_BUFFER_SHUTDOWN", true);
          for ($i=0, $n = ob_get_level(); $i < $n; $i++)
          {
            ob_end_flush();
          }
        }
      );
    }
    ....

  }	

На строке ob_start(array(&$APPLICATION, "EndBufferContent"));


buffer_content cannot be set to N because some of the components fall off.
PS After the transfer from the old hosting, everything worked fine. A little time passed and away we go.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
no_one_safe, 2020-05-17
@no_one_safe

Are you sure you didn't have ob_start anywhere before?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question