Magento's website is really too slow. I have thought of many methods, referred to a lot of information, and conducted many tests. I will summarize the general steps: 1. Compress JS and CSS code. If necessary, combine all CSS and JS into one file, compress and cache them. 2. Clear unnecessary comments in the magento template to slim down the images used 3. Optimize the magento code. This step requires a lot of work, but it may be a significant step, but the premise is that you are very familiar with magento, completely delete unused modules, and close useless blocks, clear invalid and useless XML (parsing XML is very expensive). Try not to call magento's image resize function in a large amount on a page, which consumes a lot of memory unless you optimize the code yourself. 4. MySQL configuration optimization: Make full use of your hardware resources. The following values must be adjusted based on your configuration. Key_buffer_size = 512 m Max_allowed_packet = 64 m Table_cache = 512 Sort_buffer_size = 4 m Net_buffer_length = 8 K Read_buffer_size = 4 m Read_rnd_buffer_size = 2 m Myisam_sort_buffer_size = 64 m Tmp_table_size = 128 m Query_cache_size = 96 m Query_cache_type = 1 Thread_cache_size = 8 Max_connections = 400 Wait_timeout = 300 5. Mount the VaR directory of magento to the memory to speed up reading, as shown in figure Mount-T tmpfs-O size = 100 m, mode = 0777 tmpfs VaR 6. Install the PHP accelerator, such as APC, xcache, and eaccelerator. For the installation method, refer to related websites. However, the root cause is that the biggest optimization comes from the optimization of templates, codes, and blocks. Http://www.magentocommerce.com/blog/comments/performance-is-key-notes-on-magentos-performance/ Http://www.magentocommerce.com/blog/comments/understanding-magento-scalability-and-performance-1/ |