A
A
Andrew2021-03-26 17:05:15
1C-Bitrix
Andrew, 2021-03-26 17:05:15

Why is the footer.php of Bitrix executed several times?

If we add this code to the footer*, and then look at the paths in cookies, we will see that two or three paths were recorded, which means the code was executed several times.

<?
  $curPage = $APPLICATION->GetCurPage(false);
  $cookiePath = unserialize($_COOKIE['pathBX']);
  $cookiePath[] = $curPage;
  setcookie("pathBX", serialize($cookiePath), time() + 86400, '/');
  ?>

How to deal with it? What it is? Why does it occur? Any
comments *footer - footer.php file in template folder which require_once into page

found that it tries to get style.css.map file, doesn't find it and restarts footer, then doesn't find ajax-loader.gif file and restarts footer.
In total, the footer worked three times, and $APPLICATION->GetCurPage(false) returned three different paths, the footer code worked three times. Corrected the files and created - the footer worked once, as expected.
What are your thoughts on this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2021-03-26
@idruweb

possibly loading a 404 page that also has a header and footer

A
Alexey Emelyanov, 2021-03-26
@babarun

You have a crookedly configured web server, nginx should intercept requests for static

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question