Bitrix know what a cache file was used to generate the page? Is it possible through the api to clear the cache component to a particular user?

/!\Pointed out the question tags 1C-Bitrix and Caching, if the question does not apply to the second tag please remove it.

The question aims to find approaches to the development of bitrix with intelligent cache management, so no need to restrict answers to a specific task.

There is an online shop on bitrix in this directory. With the withdrawal of the directory partition is called a component, which inside calls another, so it comes to conclusion of the specific products(to display the html of each item is called a component catalog.item). I write all this to make it clear which component is inside the other along the chain, thus cakeservers dynamic data above is the component in which they are queried from the database.

In particular, there are self-written parser library for displaying 'likes' on the goods (code here, although the question has nothing to do - blog.ivru.net/?id=49 )

So when you click on the like request goes to api changes the Statute of Laika(set shot), but when reloading page, the directory information is not displayed as output the cache of the upstream component and to request information in the file result-modifier.php the component catalog.item just don't get it.

Then a moment, to actually reset the cache, I can file which takes ajax to change the status. For example BXClearCache(true, "/s1/bitrix/catalog.section/"); (tested working), only this will clean the cache of the entire catalog.section including other users whose information could continue to load from the cache.

Interested in the following questions:
1) is it possible to obtain in the process the name of the cache file from which you originally loaded the page? Then I would just remove this file.
2) are there any mechanisms to control the cache component is linked to the user?(I mean if user session is suddenly enough to manage it in its cache, then in the ajax request I have to pass the address of the cache file, if all you need is in session).
March 23rd 20 at 19:11
2 answers
March 23rd 20 at 19:13
All you need not to cache these likes, if it is meant as a user added something to your favorites. Otherwise, you're just going to cache a lot of the same information, where the only difference is the user ID.

and if the huskies means the number, i.e. 10 users have clicked, and next to the button displays the number 10, it is necessary to clear the cache by key. In General you just have to know this key, or folder.
Create an object cache \Bitrix\Main\Data\Cache::createInstance(), and there are cleaning methods.
Cache key in the standard components, as a rule, depends on the path in the address bar. Although he could himself in the source view..

In any case, the easiest way to create your component with this button, even if it is some kind of cache, to connect this component to bypass the shared cache of the page is/product.
And it is possible some example for working with class Cashe? Since the documentation for the class https://dev.1c-bitrix.ru/api_d7/bitrix/main/data/cache/ not really clear what You propose to do it. - augustine.Rohan commented on March 23rd 20 at 19:16
And an example of how the cache key to obtain? - augustine.Rohan commented on March 23rd 20 at 19:19
Nothing should be done in it. The PLO's need to know, and the normal IDE to use for running around at the source.
The class has two methods, `clean` and `cleanDir` what are you going to use I have no idea to the answer above I described the General logic of how it's supposed to be about.

And an example of how the cache key to obtain?

we must look the source code of the component, as it is formed.
but if I just want to clear the cache of standard components, you probably need to use the `cleanDir`, where `$initDir` probably coincides with the address bar - Beau_West commented on March 23rd 20 at 19:22
@Beau_West, do I understand correctly that in the official documentation methods `clean` and `cleanDir` is not described? - augustine.Rohan commented on March 23rd 20 at 19:25
March 23rd 20 at 19:15
If you have a cache for each user, then something went wrong. The cache will only eat disk space and performance gain is not likely to be.

Everything related to the display of items private to the user button, the button basket, wish lists, etc. - then it is better to ship via ajax. You are so the page can give the user faster.

About clearing the cache. In Bitrix classes for working with cache a lot. Where and how is used you can say just by looking the source code of the component. Also there is no uniform standard for forming cache keys.
>>About clearing your cache. In Bitrix classes for working with cache a lot.

Can at least the basic applicable under the task to find out? - augustine.Rohan commented on March 23rd 20 at 19:18
@Oleta.Heathco, tell me more please is there any possibility to specify in the component template region that does not need to cache?
Saw something similar to composite, but I have no composite mode. - augustine.Rohan commented on March 23rd 20 at 19:24
Saw something similar to composite, but I have no composite mode.


For the composite can. But this does not disable caching. When you load the page in blocks which are marked contains content, only it will be updated with additional ajax request.

Here then is how to flag the current cache component with its tag. In the future, when you update data, you can reset the cache with this tag.

In General, read what is written about the cache for those links + more here it is https://dev.1c-bitrix.ru/learning/course/index.php... - Oleta.Heathco commented on March 23rd 20 at 19:27
@Oleta.Heathco, please Explain the situation with the tag in the cache when one component calls another, for example to level 3.
Whether the component nesting level 3 mark from your result_modifier.php the cache tag?

And tags, if you delete cache by tag optimized if the algorithm is? I mean't will this framework to access all cache files(and there may be quite a lot) to check whether a tag to it or not? That is, is there an index on the basis of him not to open a bunch of files, the size of which may be significant? - augustine.Rohan commented on March 23rd 20 at 19:30

Find more questions by tags Caching1C-Bitrix