Jump to content

Memcached and PrestaShop 1.7.4.2


Kevin

Recommended Posts

Hi,

 

Anybody got memcached working with PrestaShop 1.7.4.2?

First of all pressing the Test button will always result in a red box, looks like it's not validated although it is and it's working.

After saving and trying to load the frontpage i get the following error: 

FatalErrorException

Error: Maximum execution time of 60 seconds exceeded

in CacheMemcached.php line 94

 

If i debug i see that the set works a lot of times but at one moment it fails(maybe when the set is too big?).

Anybody knows how to solve this?

Thanks,

Kevin

Link to comment
Share on other sites

For everyone experiencing this problem. It seems memcached cannot handle too large arrays. PrestaShop doesn't check for this.

Solution would be to change the set function of the CacheMemcached.php class to something like:

/**
     * @inheritdoc
     */
    public function set($key, $value, $ttl = 0)
    {
        if(sizeof($value) <= 2000){
            return $this->_set($key, $value, $ttl);
        }else{
            return false;
        }
    }

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...