【问题标题】:CakePhp Cache Clear All ModelsCakePhp 缓存清除所有模型
【发布时间】:2016-05-04 06:13:54
【问题描述】:

我的 core.php 中有这个配置

 $memcacheServer =  '127.0.0.1:11211';
 $engine         =  'Memcached';
 Cache::config('default', array(
    'engine' => $engine,  
    'duration' => 3600,  
    'probability' => 100,  
    'prefix' => $prefix,  
    'servers' => array(
        $cacheServer // localhost, default port 11211
    ), //[optional]
            'groups' => array(
                'catalogs',
                'products',
                'aro',
                'aco',
                'product_categories',
                'available.cats',
                'available.prod.cats',
                'this.user.catalogs',
                'temp.comp.fetch' ,
                'uc'
 ),
    'persistent' => 'my_connection', // [optional] The name of the persistent connection.
    'compress' => true, // [optional] compress data in Memcached (slower, but uses less memory)
  ));
Cache::config('_cake_core_', array(
                'engine' => $engine,
                'servers' => array(
                    $memcacheServer // localhost, default port 11211
        ),
        'prefix' => $prefix . 'cake_core_',
        'path' => CACHE . 'persistent' . DS,            
        'duration' => $duration,
        'persistent' => 'my_connection'
));

   Cache::config('_cake_model_', array(
    'engine'  => $engine,
        'servers' => array(
                    $memcacheServer // localhost, default port 11211
        ),
    'prefix' => $prefix . 'cake_model_',
    'path'   => CACHE . 'models' . DS,
    'duration'   => $duration,
        'persistent' => 'my_connection'
));

当我保存时,在某些情况下,我会保存

 Cache::clearGroup('available.prod.cats');
            Cache::clearGroup('available.prod.cats');
            Cache::clearGroup('this.user.catalogs');

Cake 似乎删除了所有与 AroAco 模型相关的缓存模型。为什么?

【问题讨论】:

    标签: cakephp caching memcached


    【解决方案1】:
    cake cache clear_all 
    

    在你的 cmd 上使用它

    【讨论】:

    • 您能否详细说明一下这个答案?为什么会这样?
    猜你喜欢
    • 2010-10-07
    • 2014-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-05
    • 1970-01-01
    • 2017-09-18
    相关资源
    最近更新 更多