Optimization of e-commerce sites

 

In order to improve the user experience of e-commerce websites, I have been doing this recently, and I will summarize my experience.

Summary aspects

1. CDN aspects

a. Open the free cdn and cache the pictures;

 

2. nginx optimization

a. Files and applications are deployed on separate servers, at least separate domain name access;

b. Open the gzip of nginx, the main compression level of gzip, I used level 6;

c. nginx increases the caching time for static files, such as image files, which can be cached for 1 week, and css or js, which can be cached for 1 day;

 

3. java backend optimization

a. For the home page to be cached, my strategy is to cache once every 5 minutes;

b. Minimize data connections as much as possible;

 

4. Front-end optimization

a. Be sure to use delayed loading. We usually know the delayed loading of images, and the other is the delayed loading of js, which uses settimeout for delayed loading;

b. Merge js and css into one file as much as possible. You can consider manual merging. If there are many files, you can consider automatic merging with tools such as gulp;

c. For unnecessary third-party statistics and third-party customer service, please use the delayed loading of js;

d. js file, if it is not necessary, please put it before </body>, do not put it in <head>

 

5. Operation

a. The size of the first carousel image must be well controlled, and it should not exceed 200K as much as possible;

b. If possible, separate the database server, application server, and web server;

c. If the budget is possible, please use the charged CDN

 

6. In terms of tools,

a, gulp, front-end packaging tool, css, js merging, it is recommended not to optimize, it seems that there is a problem with optimization, I am not sure if it is my own problem or the gulp tool needs to set logic;

b. Optimization tool https://gtmetrix.com

c. Optimize and test the tool ngrok  to convert the internal and external networks

d. Free cdn tool, currently used jiasule, ready for Baidu

e, stackoverflow search for a good tool bird.so

 

Optimized content for later preparation

1. Prepare to build redist or memcached

2. Use service worker

3. Use appcache

4. Use H5's localized storage;

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326618035&siteId=291194637