我的公司正在使用PrestaShop 1.4.9.0,我们在数据库中有~170000个产品,~3000个客户,〜5000个订单。我们同时有大约50名访客,但我们预计未来几周会增加4-8倍。
您有什么建议可以改善PrestaShop的响应时间?
答案 0 :(得分:1)
检查Cache
中的Performance
并将其放到Memcached
,例如它是否已经存在。还可以使用PHP Profiler
检查性能并根据结果解决任何问题。还有一个非常重要的一点是函数file_exists
PS validator坚持用file_exists
Tools::file_exists_cache
/**
* 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
(商业)
答案 1 :(得分:1)
您可以启用DEBUG模式,Prestashop将显示任何已安装的模块及其加载时间。然后,您可以找到哪个模块正在减慢您的商店。
要启用DEBUGGING模式,请转到“config / defines.inc.php”并更改该行:
define('_PS_MODE_DEV_', false);
要'真实'。