A few days ago, I received an inquiry from a foreign trade company in Guangzhou, saying that his website crashed after opening it for a while, and then stopped working after opening it for a while. I checked his website and found out that it was caused by insufficient resources. After ruling out viruses and servers, we found that he has almost 40,000 products. Since he is a clothing manufacturer, each product has attributes such as color and size, and the attributes have 100,000 data, and there are more than 4,000 messages. strip. There are more than 20,000 orders. There are other messy data, estimated to be more than 20W of data, and the system is built using the most popular open source software ECSHOP online mall system.
The solution we proposed is to use ECSHOP to statically generate HTML. Generate static pages for all product ECSHOP articles. ECSHOP static files no longer need to work hard to read the database, which can reduce most resources, and the speed will be several times faster. The difficulty is that ECSHOP's js still uses a very old architecture. After the static technology is generated, because a lot of data in the mall changes, such as member registration or login status, browsing history and other data, these data need to be realized through AJAX technology, and ecshop's architecture is not compatible. JQ, so the jq compatibility issue of ECSHOP needs to be solved. Another difficulty is the speed of generation, resource allocation and stability during generation. The data is relatively large and it will be very troublesome if the generation is too slow. It will also be troublesome if it takes up too many resources when generating. So these are things we have to consider. After two weeks of renovation, we solved this problem perfectly.
We made the following effects:
1. We can customize static URLs for all generated directories, which is more suitable for website marketing optimization, etc. See below.
ecshop文章分类名称自定义静态url

ecshop产品分类名称自定义静态url

ecshop产品名称自定义静态url

ecshop文章名称自定义静态url
而在ECSHOP的静态生成方式上,为了更加保险和稳定性,我们采取了下面的各种生成方式,见下图:

After the above measures for ecshop to statically generate HTML, our customer has basically not had to shut down the computer for a month, and there has been a qualitative change in speed and user experience. In terms of search collection, there are more collections than before.
PS: Consider the overall SEO and optimization details caused by the static generation of this ECSHOP, such as repeated inclusion. Just say it briefly. For example, index.php and index.html in the root directory, such as category.php, goods.php and generated static files, etc. We have encapsulated these static page files into another folder to solve this problem. There may be a problem with repeated inclusion. In addition, some optimizations have been made to the cache and session of the program.