A
A
Alexander2018-10-09 14:18:13
1C-Bitrix
Alexander, 2018-10-09 14:18:13

How to invalidate the tagged cache of all sites?

There is a two-site configuration. Moreover, s1 is a public site, and s2 is an internal site of the company. Accordingly, employees make changes from s2. But the tagged cache set to s1 is not invalidated.
Those. let's say on the s1 side in the component:

....
                global $CACHE_MANAGER;
                $CACHE_MANAGER->StartTagCache($cache_dir);
                $CACHE_MANAGER->RegisterTag("update_events");
                $CACHE_MANAGER->RegisterTag("update_courses");
                $CACHE_MANAGER->EndTagCache();
....

Somewhere in the s2 event listener:
global $CACHE_MANAGER;
$CACHE_MANAGER->ClearByTag("update_events");

The cache of the s1 component, as it was valid, remains so. What are the solutions, besides the most obvious - to use a cron agent that will check for data changes?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Emelyanov, 2018-10-10
@babarun

Customize the method ClearByTag bxapi.ru/src/?module_id=main&name=TaggedCache::cle...
For example, make ClearByTagEx in which to remove the filter by SITE_ID:
5bbe1081410d8467116755.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question