首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何加速magento网站?

如何加速magento网站?
EN

Stack Overflow用户
提问于 2017-11-18 19:41:47
回答 3查看 217关注 0票数 0

我的网站是www.suresafety.com,版本是magento 1.9.2.0。在过去的1.5年里,它工作得很好,但是从过去的2个月来看,它太慢了。里面有1400种产品。

它在速度洞察力方面的速度在一年前是83。现在是39,这对我们的电子商务不好。

我已经完成了以下所有步骤:

1)合并CSS和JS文件·在Magento Admin中,进入System > Configuration > Developer。·在“Javascript Settings”下,将“Merge Javascript Files”更改为YES。·在“CSS设置”下,将“合并CSS文件”更改为YES。·清除缓存。

2)启用平面目录

·在Magento Admin中,转至System > Configuration > Catalog。·在“前端”下,将“使用平面目录类别”改为“是”。·在“前端”下,将“使用扁平目录产品”更改为“是”。(可选)清除缓存。

3)确保压缩规则为deflate的部分没有注释,启用默认压缩规则。

代码语言:javascript
运行
复制
 ## enable apache served files compression
 ## http://developer.yahoo.com/performance/rules.html#gzip

# Insert filter on all content
###SetOutputFilter DEFLATE
# Insert filter on selected content types only
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
#Header append Vary User-Agent env=!dont-vary

4)添加图片、js、css过期时间(.htcaccess)

代码语言:javascript
运行
复制
##for image test
<IfModule mod_expires.c>
ExpiresActive On<br/>
ExpiresByType image/jpg "access 1 year"<br/>
ExpiresByType image/jpeg "access 1 year"<br/>
ExpiresByType image/gif "access 1 year"<br/>
ExpiresByType image/png "access 1 year"<br/>
ExpiresByType text/css "access 1 month"<br/>
ExpiresByType text/html "access 1 month"<br/>
ExpiresByType application/pdf "access 1 month"<br/>
ExpiresByType text/x-javascript "access 1 month"<br/>
ExpiresByType application/x-shockwave-flash "access 1 month"<br/>
ExpiresByType image/x-icon "access 1 year"<br/>
ExpiresDefault "access 1 month"<br/>
</IfModule><br/>

5) Cpanel ->在第二个选项(压缩所有内容)上优化网站-> tic

6)从页面洞察下载优化的图片,css,js (底部)

7)用旧的替换。

EN

回答 3

Stack Overflow用户

发布于 2017-11-22 20:11:42

你已经应用的大多数东西,但你也可以应用以下几点:

a-请安装以下扩展:-

https://github.com/GordonLesti/Lesti_Fpc

https://github.com/tinify/magento1-plugin

b- http://magento2x.com/optimize-magento-database-by-cleaning-log/

C-请改进您的服务器配置例如-将内存限制设置为1024M (可选)

d-安装并使用Memcache/varnish缓存(可选)

e-您可以选择专用服务器。

票数 1
EN

Stack Overflow用户

发布于 2017-11-19 17:07:57

Firebug来找出你的网站运行缓慢的原因。

票数 0
EN

Stack Overflow用户

发布于 2017-11-20 15:57:07

请查看以下url以进行速度优化:

https://www.keycdn.com/blog/speed-up-magento/

下面是关于数据库优化的信息:

设置FOREIGN_KEY_CHECKS=0;

ALTER TABLE log_url AUTO_INCREMENT=1

ALTER TABLE log_url_info AUTO_INCREMENT=1

ALTER TABLE log_visitor AUTO_INCREMENT=1

ALTER TABLE log_visitor_info AUTO_INCREMENT=1

ALTER TABLE report_event AUTO_INCREMENT=1

ALTER TABLE report_viewed_product_index AUTO_INCREMENT=1

ALTER TABLE sendfriend_log AUTO_INCREMENT=1

设置FOREIGN_KEY_CHECKS=1;

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47365643

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档