CakePHP Caching Question

I plan to use caching in CakePHP. I am wondering what happens if I update the data in my tables, will CakePHP re-cache my data?

Thanks in advance!

+3
source share
2 answers

Not automatically, no.

No matter what, your cache does not change until it expires, or until you update it. Such a cache point. The trick is to determine the correct timeframe for the expiration date and / or delete / update the cache when something changes that you want to immediately reflect.

, , , , . , , , , .

, , Twitter, , , Twitter . , , 10 , .

, , , , . , , , (, modified ) , .

.

+5

CakePHP : http://book.cakephp.org/view/156/Caching

. , core.php. , "" "" .

Cache::config('short', array(
    'engine' => 'File',
    'duration'=> '+1 hours',
    //'path' => CACHE,
    //'prefix' => 'cake_short_'
));

Cache::config('long', array(
    'engine' => 'File',
    'duration'=> '+1 week',
    'probability'=> 100,
    //'path' => CACHE . 'long' . DS,
));

, , , , . : http://book.cakephp.org/view/767/Cache-write

+2

Source: https://habr.com/ru/post/1729011/


All Articles