Enable cache in opencart

You have 4 caching method options available in stock opencart.

  • apc
  • file
  • mem
  • memcached

File cache is the default and it dos not accelerate the system. then there are apc and memcached. where memcached generally is the method that has the largest performance boost.

But you have to make sure your webhost provider has memcache installed and available on your hostingplan.

You can create a new file on your webspace with the code below, and set your browser to it http://www.yourshop.com/php.php and then it wil give you the information about memcached. it is a long list so you can use ctrl+f to search for memcached. remember to delete the file efter you have searched it.

<?php phpinfo();?>
Code language: HTML, XML (xml)


You need some information in order to use memcached

How to enable

You need to manually edit system/config/default.php (opencart 3)

// Cache $_['cache_engine'] = 'apc'; // apc, file, mem or memcached $_['cache_expire'] = 3600;
Code language: PHP (php)

And if you choose to use memcached you need to set up the server details obtained from your hostingprovider in file in root named config.php

//cache define('CACHE_HOSTNAME', ''); define('CACHE_PORT', '11864'); define('CACHE_PREFIX', 'oc_');
Code language: JavaScript (javascript)

About the Author: admin

Skriv et svar

Din e-mailadresse vil ikke blive publiceret. Krævede felter er markeret med *