Magento How to speed up the site

假装没事ソ 提交于 2020-01-14 04:55:29

问题


I am facing one problem while loading my magento site. when refreshing my site it will take a time to load site, so i just want to decreased the loading time of my magento site so will you please anybody have an idea how to increase the loading speed of site and make my site speedy.

My site content lot's of images so i think it will take a time while loading the site.

i already try to compress the images as per suggested in this link [ http://imwill.com/magento-image-compression-solution/#.USXC1B1HJyw ] but still facing the same problem .

so i hope some one is here who will help to speed up my site.

waiting for you kind response


回答1:


There are already many articles on net about this..

For Images and Static files

  • Use CDN (images, js, css)

For Caching

  • Implement memcache

For Compiling PHP files

  • Enable PHP's APC extension OR enable Magento's compilation (Admin > System > Tools > Compilation)

Mysql Performance

  • Tweak Mysql for optimal performance (increase mysql's query_cache_size, etc.. as per usage)
  • Use Mysql master-slave replication if you have lots of database requests

Magento optimization

  • Disable modules you are not using
  • Check the code, optimize it

This is a start.. You will need to do many things..




回答2:


Add below code in your .htaccess file

<IfModule mod_expires.c>
 ExpiresActive on
 ExpiresDefault "access plus 1 year"

 ExpiresByType image/jpg "access 1 year"
 ExpiresByType image/jpeg "access 1 year"
 ExpiresByType image/gif "access 1 year"
 ExpiresByType image/png "access 1 year"
 ExpiresByType image/svg+xml "access plus 1 month"
 ExpiresByType text/css "access 1 month"
 ExpiresByType application/pdf "access 1 month"
 ExpiresByType application/x-javascript "access 1 month"
 ExpiresByType application/x-shockwave-flash "access 1 month"
 ExpiresByType image/x-icon "access 1 year"    
 ExpiresByType application/javascript "access plus 1 year"
 ExpiresByType font/truetype "access plus 1 month"
 ExpiresByType font/opentype "access plus 1 month"
 ExpiresByType application/x-font-woff   "access plus 1 month"   
 ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
</IfModule>

<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file \.(html?|txt|css|js|php|pl|asp|html|woff)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

<IfModule mod_headers.c>
  Header set Connection keep-alive     
  <FilesMatch ".(js|css|xml|gz|html)$">
    Header append Vary: Accept-Encoding
  </FilesMatch>
  <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$">        
    Header unset ETag
    FileETag None
  </FilesMatch>
</IfModule>

<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent
</IfModule>



回答3:


We have to use web page speed optimization techniques to improve our loading speed. I came to know about this info by going through the post here which helped me to speed up my magento store. It worked for me. Surely following these methods will help you rectify the issues.



来源:https://stackoverflow.com/questions/14996614/magento-how-to-speed-up-the-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!