使用Memcache进行缓存

PHP Memcache 3.0.8 Windows

Memcache can have a massive performance increase on small stores with lots of memory.
Memcache可以在具有大量内存的小型存储上大幅提升性能。

It’s a trade off between taking up less space or eating up more CPU cycles.
它在占用更少的空间和吃掉更多的CPU周期之间寻求平衡。

Be sure to check your phpinfo() has ‘Memcahe’ enabled before making this change.
在进行此更改之前,请务必检查系统的phpinfo()是否已经启用了“Memcache”。

Opencart 2.3 simple edit: system/config/default.php

$_['cache_type'] = 'file'; // apc, file or mem
$_['cache_expire'] = 3600;

Older version than 2.3  require small changes.
低于2.3的版本需要做些小的变动。

  1. Add below code to: config.php AND admin/config.php
    // Cache
    define('CACHE_DRIVER', 'mem'); // 'file', 'apc' or 'mem'
    define('CACHE_HOSTNAME', 'localhost');
    define('CACHE_PORT', '11211');
    define('CACHE_PREFIX', 'oc_');
  2. Edit index.php  AND admin/index.php
    Replace
    $cache = new Cache('file');
    With
    $cache = new Cache(CACHE_DRIVER);

未经允许不得转载:又闻琴音 » 使用Memcache进行缓存

赞 (0) 评论 (0) 分享 ()

评论 抢沙发

评论前必须登录!