• 首页
    • English
    • 中文
  • 关于我们
  • 服务项目
    • 谷歌SEO服务
    • WordPress建站服务
    • 谷歌ADS/SEM代运营
  • 项目案例
    • 医疗
    • 建材
    • 机械加工
    • 照明
    • 电商
    • 电脑硬件
  • 博客
    • 服务器运维
      • aliyun
      • 服务器安装
      • 宝塔面板
      • 虚拟化
      • 阿里云
      • Centos
      • linux
      • nginx
    • 电子商务
    • 免费资源
    • PHP
      • Magento
      • WordPress
    • 大数据采集
    • Python
    • Javascript
    • SEO
    • 未分类
  • 联系我们
What's Hot

机械模具加工公司网站设计案例

24 10 月, 2023

快速原型公司案例

24 10 月, 2023

陶瓷加工网站案例

24 10 月, 2023
Facebook Twitter Instagram
  • 中文
  • English
Facebook Twitter Instagram
VPSEO VPSEO
  • 首页
    • English
    • 中文
  • 关于我们
  • 服务项目
    • 谷歌SEO服务
    • WordPress建站服务
    • 谷歌ADS/SEM代运营
  • 项目案例
    • 医疗
    • 建材
    • 机械加工
    • 照明
    • 电商
    • 电脑硬件
  • 博客
    • 服务器运维
      • aliyun
      • 服务器安装
      • 宝塔面板
      • 虚拟化
      • 阿里云
      • Centos
      • linux
      • nginx
    • 电子商务
    • 免费资源
    • PHP
      • Magento
      • WordPress
    • 大数据采集
    • Python
    • Javascript
    • SEO
    • 未分类
  • 联系我们
VPSEO VPSEO
Home»Uncategorized»11种方法给magento 加速
Uncategorized

11种方法给magento 加速

chrispengcnBy chrispengcn7 8 月, 2021没有评论3 Mins Read
Facebook Twitter Pinterest LinkedIn Tumblr Email
Share
Facebook Twitter LinkedIn Pinterest Email

1、安装Fooman Speedster插件
插件官方地址:http://www.magentocommerce.com/m … 57/fooman-speedster
这款插件主要通过合并、压缩js和CSS来加速,不知道这个和使用Magento自带的合并功能有什么区别。
2、在.htaccess中开启Gzip压缩
在.htaccess的52行左右的位置移除#号

1. #php_flag zlib.output_compression on

复制代码

将以下.htaccess

1. ############################################

2. ## enable apache served files compression

3. ## http://developer.yahoo.com/performance/rules.html#gzip

4. 

5.     # Insert filter

6.     #SetOutputFilter DEFLATE

7. 

8.     # Netscape 4.x has some problems…

9.     #BrowserMatch ^Mozilla/4 gzip-only-text/html

10. 

11.     # Netscape 4.06-4.08 have some more problems

12.     #BrowserMatch ^Mozilla/4.0[678] no-gzip

13. 

14.     # MSIE masquerades as Netscape, but it is fine

15.     #BrowserMatch bMSIE !no-gzip !gzip-only-text/html

16.     # Don’t compress images

17.     #SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary

18. 

19.     # Make sure proxies don’t deliver the wrong content

20.     #Header append Vary User-Agent env=!dont-vary

21. 

22. </IfModule>

复制代码

把一些#号去掉

1. ############################################

2. ## enable apache served files compression

3. ## http://developer.yahoo.com/performance/rules.html#gzip

4. 

5.     # Insert filter

6.    SetOutputFilter DEFLATE

7. 

8.     # Netscape 4.x has some problems…

9.     BrowserMatch ^Mozilla/4 gzip-only-text/html

10. 

11.     # Netscape 4.06-4.08 have some more problems

12.    BrowserMatch ^Mozilla/4.0[678] no-gzip

13. 

14.     # MSIE masquerades as Netscape, but it is fine

15.   BrowserMatch bMSIE !no-gzip !gzip-only-text/html

16.     # Don’t compress images

17.     SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary

18. 

19.     # Make sure proxies don’t deliver the wrong content

20.     Header append Vary User-Agent env=!dont-vary

21. 

22. </IfModule>

复制代码

3、安装 APC or Xcache
APC – http://pecl.php.net/package/APC
Xcache – http://xcache.lighttpd.net/
apc使add to cart两秒内加载的方法
在你安装激活apc之后,找到app/etc/local.xml 文件
在<global>下添加如下block

1. <global>

2. ………………..

3. <cache>

4. <backend>apc</backend>

5. <prefix>alphanumeric</prefix>

6. </cache>

7. ………………….

8. 

复制代码

以上需要注意的是如果你的服务器有超过一个Magento程序,apc在缓存上会有一些混乱
可以试着使每个Magento网站<prefix>alphanumeric</prefix>内容不同
第一个网站<prefix>siteA</prefix>
第二个网站<prefix>siteB</prefix>
提速的重点在于成功安装apc
4、修改Mysql服务器的配置好好利用服务器的内存
绝大部分Linux发行版提供一个保守的mysql包来确保能运行在大范围的硬件上。如果你有足够的内存(比如,1gb或者更多),接着你可能会想调整设置。一个my.cnf的示例如下,

1. key_buffer = 512M

2. max_allowed_packet = 64M

3. table_cache = 512

4. sort_buffer_size = 4m

5. read_buffer_size = 4m

6. read_rnd_buffer_size = 2m

7. myisam_sort_buffer_size = 64m

8. tmp_table_size = 128m

9. query_cache_size = 96m

10. query_cache_type = 1

11. thread_cache_size = 8

12. max_connections = 400

13. wait_timeout = 300

复制代码

5、Magento缓存
转到Magento admin->system->Cache management
选中以下条目:
— Configuration
— Layouts
— Block HTML output
— Translations
以下条目就不用选中了
— Collections Data
— EAV types and attributes
— Web Services Configuration
6、开启编译
转到System > Tools > Compilation,报道称能给你提速25%-50%。
7、使用cdn加速
你可以使用Magento插件来帮助你
http://www.magentocommerce.com/magento-connect/One+Pica/extension/1279/one-pica-image-cdn
其他关于前端模板代码方面的优化如图片优化、使用CSS Sprite等论坛其他帖子。
以上方法整理来源于以下网站:
http://www.magentocommerce.com/boards/viewthread/36225/
http://www.gxjansen.com/101-ways-to-speed-up-your-magento-e-commerce-website/
8. 将magento的var目录挂载到内存中,加快读取速度,如
mount -t tmpfs -o size=100M,mode=0777 tmpfs var
9. 打开apache的KeepAlives,可以让多个请求使用一个TCP连接,加快速度
修改/etc/httpd/conf/httpd.conf: KeepAlive On
10. Magento1.5中可以开启CSS和JS合并
SYSTEM -> CONFIGURATION / ADVANCED -> DEVELOPER
enable
Merge JavaScript Files set to Yes
Merge CSS Files set to Yes
11. 增加PHP Memory Limit
如果2G内存,可以通过修改php.ini 将memory_limit设置为128MB

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
chrispengcn
  • Website

Related Posts

Nginx做负载均衡,有没有办法碰到404就跳过?

2 7 月, 2022

如何快速把多个excel表合并成一个excel表

7 8 月, 2021

nginx配置泛域名转发到子目录nginx泛域名转发到泛域名

7 8 月, 2021

wordpress如何防止发布文章时候自动清除

、
换行标签

7 8 月, 2021
Add A Comment

Leave A Reply Cancel Reply

*

code

导航
  • 首页
  • 关于我们
  • 服务项目
  • 项目案例
  • 博客文章
  • 联系我们
博客
  • 服务器运维
  • 服务器安装
  • nginx
  • PHP
  • WordPress
  • Python
  • Javascript
  • SEO
  • 电子商务
  • 大数据采集
  • 宝塔面板
  • 数据库
  • 电子商务
  • 虚拟化
  • 阿里云
导航
  • 首页
  • 关于我们
  • 谷歌SEO服务
  • 谷歌ADS/SEM代运营
  • WordPress建站服务
  • 项目案例
  • 博客
  • 联系我们
最新文章
  • 机械模具加工公司网站设计案例
  • 快速原型公司案例
  • 陶瓷加工网站案例
  • CNC数控加工日文网站案例
  • 触摸一体机数字标牌厂家网站案例
关于我们
关于我们

广州纬来科技有限公司
联系地址:广东省广州市番禺区富华中路富源二街18号合和大厦809

QQ : 13602156
Email : 13926026058@139.com
Contact: +86 13926026058

Facebook Twitter YouTube LinkedIn
© 2025 广州纬来科技有限公司 粤ICP备2023105857号-2
  • 首页
  • 关于我们
  • 谷歌SEO服务
  • 谷歌ADS/SEM代运营
  • WordPress建站服务
  • 项目案例
  • 博客
  • 联系我们

Type above and press Enter to search. Press Esc to cancel.