Получаю закешированнные данные из кода ниже, как очищать кеш при изменениях в инфоблоке?
Код |
---|
<?if(!defined("B_PROLOG_INCLUDED")||B_PROLOG_INCLUDED!==true)die();
Bitrix\Main\Loader::includeModule("iblock");
$iblockId = 3;
$sectionId = intval($_GET["id"]);
$arResult = array();
$arOrder = array('SORT'=>'ASC');
$arSelect = array('ID','NAME','CODE');
if($sectionId){
$rsParentSection = CIBlockSection::GetByID($sectionId);
$arParentSection = $rsParentSection->GetNext();
$arFilter = array('IBLOCK_ID'=>$arParentSection['IBLOCK_ID'],'>LEFT_MARGIN'=>$arParentSection['LEFT_MARGIN'],'<RIGHT_MARGIN'=>$arParentSection['RIGHT_MARGIN'],'>DEPTH_LEVEL'=>$arParentSection['DEPTH_LEVEL']);
}
else
$arFilter = array('IBLOCK_ID'=>$iblockId,'DEPTH_LEVEL'=>1);
$dbList = CIBlockSection::GetList($arOrder,$arFilter,false,$arSelect);
while($dbResult = $dbList->GetNext())
{
$dbResult['id'] = $dbResult['ID'];
$dbResult['name'] = $dbResult['NAME'];
$dbResult['code'] = $dbResult['CODE'];
unset($dbResult['ID'],$dbResult['~ID'],$dbResult['NAME'],$dbResult['~NAME'],$dbResult['CODE'],$dbResult['~CODE'],$dbResult['SORT'],$dbResult['~SORT']);
$arResult[] = $dbResult;
}
die(json_encode($arResult));
|