A
A
akula222017-07-10 19:40:01
Yii
akula22, 2017-07-10 19:40:01

How to get back a deleted cache from a backup?

I can’t understand where the file cache is stored, which I save with a command
Yii::$app->cache->set('news', $news, 0);
like runtime / cache here, but when copying this folder from backup, it doesn’t give any result, what’s the reason?
That is, I saved this folder in advance and then upload it back once a day, but there is no result.
I need to return the cache once a day as it was before any changes, how can I do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-07-10
@webinar

Perhaps the reason is 0. Since 0 is the time. If null - then the default time. If 0 then 0 0 != nullIt's worth checking here, since 2.0.11 "0" is infinite, but I don't remember how in the previous ones.
At the same time, check if the cache time is defined in the config.
As a strange, but possible option: you generally do not have yii write access to runtime / cache and the cache is simply not created there, as a result you do not see a return to the old cache, since it did not exist. This is possible, because xs with what rights and from which user this folder is created from the backup.
Another option: the cache is not in runtime/cache, if the folder is overridden in the config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question