我公司采用的是PrestaShop 1.4.9.0,数据库中有~ 170000种产品,客户约3000种,定单约5000种。我们在同一时间有大约50名游客,但我们预计未来几周还会有4-8倍的游客。
您有什么建议可以改善这个PrestaShop的响应时间?
发布于 2014-11-12 12:07:59
检查Cache中的Performance,并将其放到Memcached中,例如,如果还没有的话。还可以使用PHP Profiler检查性能,并根据结果解决任何问题。还有一个非常重要的问题,就是函数file_exists性能缓慢
PS验证器坚持用Tools::file_exists_cache代替file_exists
/**
* file_exists() wrapper with cache to speedup performance
*
* @param string $filename File name
* @return boolean Cached result of file_exists($filename)
*/
protected static $file_exists_cache = array();
public static function file_exists_cache($filename)
{
if (!isset(self::$file_exists_cache[$filename]))
self::$file_exists_cache[$filename] = file_exists($filename);
return self::$file_exists_cache[$filename];
}这段代码来自PS1.6,应该添加到Tools类中的classes/Tools.php中,如果您发现该方法已经存在,只需替换它
无论如何,分析器是解决这些问题的关键,我个人使用PHPed Profiler (商业)
发布于 2015-08-28 12:24:54
您可以启用调试模式,Prestashop将显示任何已安装的模块及其加载时间。然后,你可以找到什么模块正在放慢你的商店。
要启用调试模式,请转到“config/fines.inc.php”并更改行:
define('_PS_MODE_DEV_', false);变成“真”。
https://stackoverflow.com/questions/26884752
复制相似问题