How to use CDN

 

HTML:

http://enterprise.qbao.com/images/logo.png 

http://enterprise.qbao.com/wapShop/style/info.css 

http://enterprise.qbao.com/wapShop/script/info.js 

 

Put the static resources on the CDN and change the above URL to:

www.qbcdn.com/enterprise/images/****

www.qbcdn.com/enterprise/wapShop/****

 

The url mapping needs to be configured on the CDN. When the resource cannot be found, the resource can be obtained from the business server

www.qbcdn.com/enterprise/  --------》 enterprise.qbao.com 

www.qbcdn.com/goods/  --------》 goods.qbao.com 

 

Runtime access path:

Browser ----" CDN ---- If not, follow the mapping and get resources from the business server ---" enterprise (goods, app)

 

After the CDN is introduced, if you change JS, you need to pay attention to modifying the version number or clearing the CDN.

 

Introducing the version number is obviously a better way, but considering that some JS are public (in multiple systems), modifying the version number requires modifying multiple code branches, which is troublesome. Clearing the CDN is also possible.

 

==============

How the test environment handles CDN:

 

The test environment does not need to deploy CDN, directly map on ngnix, and convert the CDN path ----- to ------" access path of business tomcat

Guess you like

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