Answer the question
In order to leave comments, you need to log in
How best to use caching when filtering by date?
Elements of the "Events" infoblock with the "Event start date (character code DATE_START)" property are given. You need to get separately upcoming events (from the current date) and separately past events (before the current date). When setting the filter by the current date (see example below), there will be a separate cache file for each day.
$GLOBALS[$arParams['FILTER_NAME']]['>PROPERTY_DATE_START'] = date('Y-m-d');
$APPLICATION->IncludeComponent('bitrix:news.list', '.default', ['CACHE_FILTER' => 'Y']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question