CN114363322A - CDN uploading system for static resources - Google Patents
CDN uploading system for static resources Download PDFInfo
- Publication number
- CN114363322A CN114363322A CN202210007588.8A CN202210007588A CN114363322A CN 114363322 A CN114363322 A CN 114363322A CN 202210007588 A CN202210007588 A CN 202210007588A CN 114363322 A CN114363322 A CN 114363322A
- Authority
- CN
- China
- Prior art keywords
- uploading
- cdn
- upload
- npm
- web
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a CDN uploading system for static resources. The system comprises: npm uploading tool, Web end, Node service end, npm uploading tool installed in development environment by developer, Web end and Node service end deployed in server, developer can access Web end through domain name, Node service end used for npm uploading tool and Web end provide service interface, npm uploading tool used for obtaining uploading token through the service interface provided by Node service end and caching to local, and after caching token to local, uploading file to CDN, Web end used for file uploading record viewing and uploading authority management. The CDN uploading system for the static resources can freely and safely upload files on the premise of not adjusting a rear-end interface.
Description
Technical Field
The invention relates to the technical field of content delivery networks, in particular to a CDN uploading system for static resources.
Background
At present, the internet is growing, and its content is not presented as simple text information but is presented together with pictures, audio, video, pdf and other various files with richer content. These files are bulky and slow to transfer, but the content is essentially unchanged. CDN technology is then in force.
The CDN files are very convenient to view and download, only one browser is needed, but no mature scheme is available for uploading the files to the CDN.
The existing uploading scheme comprises the following steps:
firstly, directly uploading files on a CDN official network;
secondly, in order to avoid direct operation of the CDN by developers, operation and maintenance personnel can uniformly examine, approve and upload;
and thirdly, the back end provides an interface, and the front end calls for uploading.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a CDN uploading system for static resources, which can realize free and safe file uploading without adjusting a rear-end interface.
In order to solve the technical problem, the present invention provides a CDN upload system for static resources, including: npm uploading tool, Web end, Node service end, npm uploading tool installed in development environment by developer, Web end and Node service end deployed in server, developer can access Web end through domain name, Node service end used for npm uploading tool and Web end provide service interface, npm uploading tool used for obtaining uploading token through the service interface provided by Node service end and caching to local, and after caching token to local, uploading file to CDN, Web end used for file uploading record viewing and uploading authority management.
In some embodiments, the file upload performed by the npm upload tool includes: and uploading the script executed by writing the js script, and uploading the command executed by writing the uploading configuration.
In some embodiments, the npm upload tool is further to: and providing an uploading person token, an authority ID, an item name and a folder.
In some embodiments, the viewing of the upload record by the Web site includes: npm upload records, record uploaders, upload time, upload items, and view details of each file uploaded.
In some embodiments, the Web-side is further configured to: and managing the uploading authority.
In some embodiments, managing the uploader right comprises: managing an Admin account, the Admin account being for: create a rights ID and assign a group leader rights ID.
In some embodiments, one privilege ID corresponds to one group leader and multiple developers, and the group leader may assign administrative privileges to the group members.
In some embodiments, the Web-side is further configured to: each rights ID is assigned a CDN subdirectory as a cloud disk.
In some embodiments, the Node server is further configured to: an interface is provided for the web side to manage the rights.
In some embodiments, the Node server is further configured to: and providing an interface for uploading files to the cloud disk for the web end.
After adopting such design, the invention has at least the following advantages:
the CDN uploading and loading speed of static resources in HTML are facilitated;
second, CDN version delivery of npm bundles or sdk bundles is facilitated;
and thirdly, releasing the uploading limit, so that the developer can freely upload the file to the CDN at any time and in any project.
Drawings
The foregoing is only an overview of the technical solutions of the present invention, and in order to make the technical solutions of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and the detailed description.
FIG. 1 is a schematic diagram of an HTML structure prior to optimization;
FIG. 2 is a schematic diagram of an optimized HTML structure.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
One and one set of scheme
1.1npm upload tool (demo-upload)
Use 1: the console acquires and inputs a user name and a password, and the interface is adjusted to acquire and upload the token and cache the token to the local. Calling a Node service interface and providing the following information: uploading a person token, an authority ID, a project name and a folder.
Upload method 1: and compiling js script and executing script uploading.
And an uploading mode 2: and compiling an uploading configuration and executing uploading of an uploading command.
1.2Web end
Use 1: and viewing npm the uploading record, recording the uploader, the uploading time, the uploading project and uploading the details of each file.
Use 2: and managing the uploading authority. An Admin account for creating the rights ID and assigning the group leader rights ID. One authority ID corresponds to one group leader and a plurality of developers. The group leader may assign administrative rights to the group members.
Use 3: each rights ID is assigned a CDN subdirectory as a cloud disk, e.g., "/cluster/rights ID". The person who owns the authority ID can click an upload button to upload to the CDN subdirectory, and the CDN file name can be random or customized and can be uploaded again after being overwritten.
1.3Node server
Interface definition 1: an interface is provided for npm, whether the uploader has the authority to upload the authority ID is checked, and the received folder is uploaded to the CDN concurrently according to the "project name + file relative path + file name". And records the upload log.
Interface definition 2: an interface is provided for the web side to manage the rights.
Interface definition 3: and providing an interface for uploading files to the cloud disk for the web end.
Second, notes and matters
2.1CDN complete Path description: https:// _ CDN. com (CDN domain name) + authority ID + item name + file relative path + file name.
2.2 following the uploading rule of 'same CDN path coverage, different CDN path newly added'. After the CDN is uploaded, different functions can be executed according to conditions: the new project performs CDN warm-up and the existing project performs CDN refresh.
2.3 static resources can use a hash filename or a fixed filename. The fixed file name is used for configurable json on-line or configurable static resources such as pictures and the like. Uploading the same files of the same path under the same project, and directly covering and modifying the corresponding on-line CDN files.
And 2.4, the whole set of uploading system is delivered to a front-end group for maintenance, and a requirement pool is established for all developers to fill in requirements. And the front-end group responsible for maintenance carries out requirement evaluation development and keeps the iterative update of the uploading system.
Third, static resource loading optimization in HTML of practical application
3.1 optimizing content
The HTML structure before optimization (all static resources are obtained locally from the web server, using relative addresses) is shown in fig. 1.
The optimized HTML structure (all static resources are obtained from the CDN, using CDN addresses) is shown in fig. 2.
3.2 Effect of optimization
3.2.1 the speed of home page access is significantly increased and can accommodate a large number of users accessing a website simultaneously. (greatly reducing the expense of the website server and shortening the time for the user to access the static resources).
3.2.2 can directly modify the online corresponding CDN resources without repacking, thereby reducing the steps and risks of constructing the online.
Fourth, CDN version delivery of either the npm or sdk packets for real applications
4.1 optimizing content
Before optimization: the operation and maintenance personnel need to be contacted for examination and approval and then uploaded to the CDN.
After optimization: the CDN version package can be released by directly executing the uploading command or the script.
4.2 Effect of optimization
Unnecessary communication among departments is reduced, and delivery of npm-package CDN versions is promoted.
Fifth, any node environment for practical application
At any time and in any project, as long as a Node environment exists and a file is required to be uploaded to the CDN, only demo-upload is needed to be installed, upload configuration/scripts are compiled, and some static resources are directly appointed to be uploaded.
The technical problems solved by the technical scheme of the invention are as follows:
firstly, developers are prevented from directly operating the CDN.
And secondly, uploading centralized management to simplify the approval process.
And thirdly, a front-end maintenance uploading system is internally provided with customization requirements to develop online in time.
And fourthly, the initiative right of uploading the files to the CDN is given to the front end, so that the front end freely and safely uploads the files to the CDN, and the innovativeness of CDN application is stimulated.
The beneficial effects obtained by the invention are as follows:
the CDN uploading and loading speed of static resources in HTML are facilitated;
second, CDN version delivery of npm bundles or sdk bundles is facilitated;
and thirdly, releasing the uploading limit, so that the developer can freely upload the file to the CDN at any time and in any project.
npm package (master tool for developers to upload static resources):
1. the user token is obtained and cached (which may be obtained by entering a username password, or any other means).
2. And providing (token, authority ID, project name and folder information needing to be uploaded) when uploading.
3. npm internal workflow: and packaging and compressing the folder to be uploaded according to the directory structure of the folder, adding information such as token, authority ID and project name into the http request, sending the http request to a rear-end interface, and uploading by the CDN.
web services (rights management, security monitoring, log viewing, web cloud disk):
1. and the administrator configures the authority ID and manages the uploading authority of the uploading personnel by the administrator and the group leader.
2. Description of rights ID: the method can be formulated according to a service line, a project group or a certain project, and is reasonable. The method is mainly used for sorting and dividing CDN addresses and is convenient for resource management.
3. A web cloud disk: and a cloud disk is allocated to each authority ID, so that developers can conveniently upload static resources on a web page.
And (3) node service:
1. providing an interface to interface with the npm package: and after the request is acquired, verifying the user permission information. Decompressing the compressed folder, uploading all files to the CDN according to a folder directory structure, wherein the path is as follows: "CDN domain name/authority ID/item name/file relative path/file name".
2. Providing an interface to interface with a web cloud disk: and after the request is acquired, verifying the user permission information. Uploading the file to the CDN, wherein the path is as follows: "CDN domain name/authority ID/unique hash value + file name".
3. Uploading interface notes: "1, same CDN path file needs to be covered, and the CDN this file is refreshed. 2. And the CDN can be preheated by the new path file. "
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the present invention in any way, and it will be apparent to those skilled in the art that the above description of the present invention can be applied to various modifications, equivalent variations or modifications without departing from the spirit and scope of the present invention.
Claims (10)
1. A CDN upload system for static resources, comprising: npm uploading tool, Web end, Node service end, npm uploading tool installed in development environment by developer, Web end and Node service end deployed in server, developer can access Web end through domain name, Node service end used for npm uploading tool and Web end provide service interface, npm uploading tool used for obtaining uploading token through the service interface provided by Node service end and caching to local, and after caching token to local, uploading file to CDN, Web end used for file uploading record viewing and uploading authority management.
2. The CDN upload system for static resources of claim 1, wherein the file upload performed by the npm upload tool comprises: and uploading the script executed by writing the js script, and uploading the command executed by writing the uploading configuration.
3. The CDN upload system for static resources of claim 1, wherein the npm upload tool is further configured to: and providing an uploading person token, an authority ID, an item name and a folder.
4. The CDN upload system of claim 1 for static resources wherein the viewing of the upload records by the Web site comprises: npm upload records, record uploaders, upload time, upload items, and view details of each file uploaded.
5. The CDN upload system for static resources of claim 1 wherein the Web-side is further configured to: and managing the uploading authority.
6. The CDN upload system of claim 5 for static resources wherein managing upload authority comprises:
managing an Admin account, the Admin account being for: create a rights ID and assign a group leader rights ID.
7. The CDN upload system of claim 6 wherein a permission ID corresponds to a group leader and multiple developers, the group leader can assign administrative permissions to the group members.
8. The CDN upload system for static resources of claim 1 wherein the Web-side is further configured to: each rights ID is assigned a CDN subdirectory as a cloud disk.
9. The CDN upload system of claim 1 for static resources wherein the Node server is further configured to: an interface is provided for the web side to manage the rights.
10. The CDN upload system of claim 1 for static resources wherein the Node server is further configured to: and providing an interface for uploading files to the cloud disk for the web end.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210007588.8A CN114363322A (en) | 2022-01-05 | 2022-01-05 | CDN uploading system for static resources |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210007588.8A CN114363322A (en) | 2022-01-05 | 2022-01-05 | CDN uploading system for static resources |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114363322A true CN114363322A (en) | 2022-04-15 |
Family
ID=81107868
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210007588.8A Pending CN114363322A (en) | 2022-01-05 | 2022-01-05 | CDN uploading system for static resources |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114363322A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114866539A (en) * | 2022-07-06 | 2022-08-05 | 飞狐信息技术(天津)有限公司 | File uploading method and system |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105323295A (en) * | 2014-08-22 | 2016-02-10 | 航天恒星科技有限公司 | Content distribution method, content transmission method, server, end node |
CN106911672A (en) * | 2017-01-25 | 2017-06-30 | 武汉天喻教育科技有限公司 | A kind of data transmission method and system based on HTML5 |
CN109284472A (en) * | 2018-11-15 | 2019-01-29 | 福建省华渔教育科技有限公司 | Front end webpage loading method, storage medium based on webpack |
CN109450990A (en) * | 2018-10-19 | 2019-03-08 | 深圳点猫科技有限公司 | A kind of cloud storage implementation method and electronic equipment based on educational system |
CN110347385A (en) * | 2019-07-19 | 2019-10-18 | 浪潮云信息技术有限公司 | A kind of method and system that distribution Web static resource is shared |
CN111970359A (en) * | 2020-08-14 | 2020-11-20 | 工银科技有限公司 | Front-end non-service architecture system based on node |
CN113516574A (en) * | 2021-07-27 | 2021-10-19 | 北京爱学习博乐教育科技有限公司 | Self-adaptive learning system based on big data and deep learning and construction method thereof |
-
2022
- 2022-01-05 CN CN202210007588.8A patent/CN114363322A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105323295A (en) * | 2014-08-22 | 2016-02-10 | 航天恒星科技有限公司 | Content distribution method, content transmission method, server, end node |
CN106911672A (en) * | 2017-01-25 | 2017-06-30 | 武汉天喻教育科技有限公司 | A kind of data transmission method and system based on HTML5 |
CN109450990A (en) * | 2018-10-19 | 2019-03-08 | 深圳点猫科技有限公司 | A kind of cloud storage implementation method and electronic equipment based on educational system |
CN109284472A (en) * | 2018-11-15 | 2019-01-29 | 福建省华渔教育科技有限公司 | Front end webpage loading method, storage medium based on webpack |
CN110347385A (en) * | 2019-07-19 | 2019-10-18 | 浪潮云信息技术有限公司 | A kind of method and system that distribution Web static resource is shared |
CN111970359A (en) * | 2020-08-14 | 2020-11-20 | 工银科技有限公司 | Front-end non-service architecture system based on node |
CN113516574A (en) * | 2021-07-27 | 2021-10-19 | 北京爱学习博乐教育科技有限公司 | Self-adaptive learning system based on big data and deep learning and construction method thereof |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114866539A (en) * | 2022-07-06 | 2022-08-05 | 飞狐信息技术(天津)有限公司 | File uploading method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20200326927A1 (en) | Providing access to a hybrid application offline | |
US8904011B2 (en) | Resolving information in a multitenant database environment | |
US20150067019A1 (en) | Method and system for using arbitrary computing devices for distributed data processing | |
US20040073903A1 (en) | Providing access to software over a network via keys | |
US10331907B2 (en) | User photo handling and control | |
EP2828763A1 (en) | Method of modifying access control for web services using query languages | |
AU2014367176B2 (en) | Pre-authorizing a client application to access a user account on a content management system | |
WO2007032549A1 (en) | Content delivering method and system | |
CN110704375B (en) | File management method, device, equipment and computer storage medium | |
US20230104883A1 (en) | Systems and methods for managed asset distribution in a distributed heterogeneous storage environment | |
US20140108572A1 (en) | Multi-variant e-mail testing | |
CN110008131B (en) | Method and device for managing area AB experiment based on algorithm | |
CN110032544A (en) | The right management method and its cloud data-storage system of cloud service | |
US11599353B2 (en) | Hosting event-based applications | |
US10078433B2 (en) | Sharing a template file | |
CN114363322A (en) | CDN uploading system for static resources | |
US20140075322A1 (en) | Web Application Server Architecture With Embedded Scripting Language And Shell Services | |
CN110457307A (en) | Metadata management system, user's cluster creation method, device, equipment and medium | |
CN110347654B (en) | Method and device for online cluster characteristics | |
US11797701B1 (en) | Secure data collaboration | |
US20210152650A1 (en) | Extraction of data from secure data sources to a multi-tenant cloud system | |
Hwang | Supporting cloud computing in thin-client/server computing model | |
KR102495790B1 (en) | An integrated medical management system for integrating and managing data including data located on external servers | |
US11836207B2 (en) | User-initiated workflow to collect media | |
KR100879880B1 (en) | Method and system for providing electronic cabinet service |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |