F
F
faragly2015-08-11 17:53:24
PHP
faragly, 2015-08-11 17:53:24

How to update CPHPCache cache data in 1C-Bitrix?

Hello! There is a cache with a lifetime of 1 hour (3600), I store an array, but sometimes I need to update the data inside the cache, how to do this?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
vadamlyuk, 2016-06-28
@vadamlyuk

Indeed, this issue is not considered in the official documentation.
If there is a valid cache with an unexpired TTL in the cache, then you will not be able to update it.
The correct solution is to clear the cache and add a new value,
but you don't need to call ->clearDir(), just call ->clear() with the appropriate tag

S
Sergey, 2015-08-11
@SirBataneg

link to official documentation with user comments

A
Alex Khizhniy, 2015-08-11
@mendler

For example, tag and clear by tag. Or, if this is a component cache, then clear by the tag that the component puts.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question