Looking for the misty rain and the world of mortals, and thinking about poetry and painting in the south of the Yangtze River

[Operation and maintenance] Localization of static resources, recording a web page optimization process

Wandering the Jianghu 2020-07-13 Browse (5601) Comments (2)

 Qingnong.jpg [Operation and Maintenance] Localization of static resources, recording a web page optimization process

Self built personal microblog, sometimes it opens quickly, sometimes it opens slowly, Sometimes some styles cannot be loaded when opened.

I wonder, what's wrong? Attacked?

Check CDN And analyze statistics, and find that everything is normal.

Server reason? The same is true for migrating to another ECS.

Then press F12, record the network activity, and test the resource network. It is found that there are several js and css Not loaded , I unexpectedly used CloudFlare resources, which is obviously the pot of mobile broadband... I didn't expect the author to vomit with CF's static resources.

Many times the problem is not taken for granted.

https:// cdn js.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/github.min.css

https:// cdn js.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js

https:// cdn js.cloudflare.com/ajax/libs/highlight.js/9.13.1/highlight.min.js

https:// cdn js.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css

resolvent

1. Create ajax and above resource subdirectories in the root directory of the website, and download the above files to the corresponding directory.

2. Find which page called the resource according to the web page code, or directly find php Search cloudflare keywords one by one.

3. Put all https:// cdn js.cloudflare.com Delete and display as /ajax/libs/…… Resource address.

4. Refresh the homepage of the website, load it in perfect seconds, and then press F12 to check whether it is loaded normally.

 BaiduShurufa_2020-7-13_13-7-37.png [Operation and Maintenance] Localization of static resources, recording a web page optimization process


Title: [Operation and maintenance] Localization of static resources, recording a web page optimization process
Author authorization: Unless otherwise specified, this document is written by Intoxicated with Chinese style Original compilation and authorization Intoxicated with Chinese style blog Publication.
Copyright notice: This article uses the "Attribution - Noncommercial Use - Sharing in the Same Way 4.0 International" Creative Sharing Agreement. Please follow the Attribution Agreement for reprinting or use.
Comment List (2) Comments
 Netizen nickname: Xiao Ke
Xiaoke tourist 2020-09-05 reply
Long time no see, brother. splendid
The foreign cf has not been particularly good in the wall. The domestic famous ones are bootcdn and staticfile, which I know quite well
 Netizen nickname: Intoxicated with Chinese style
Intoxicated with Chinese style administrators 2020-09-05 reply
@Intoxicated with Chinese style Cf is definitely not good. Others are OK. It is better to make local quotations, and the quantity is not enough to match the domestic cdn. It may be banned from our use by Comrade Chuan Jianguo when abroad