CN103092581A - Method and device for setting up Web front-end local development environment - Google Patents

Method and device for setting up Web front-end local development environment Download PDF

Info

Publication number
CN103092581A
CN103092581A CN2011103361224A CN201110336122A CN103092581A CN 103092581 A CN103092581 A CN 103092581A CN 2011103361224 A CN2011103361224 A CN 2011103361224A CN 201110336122 A CN201110336122 A CN 201110336122A CN 103092581 A CN103092581 A CN 103092581A
Authority
CN
China
Prior art keywords
file
proxy server
local proxy
server
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.)
Granted
Application number
CN2011103361224A
Other languages
Chinese (zh)
Other versions
CN103092581B (en
Inventor
李晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201110336122.4A priority Critical patent/CN103092581B/en
Publication of CN103092581A publication Critical patent/CN103092581A/en
Priority to HK13107467.4A priority patent/HK1180406A1/en
Application granted granted Critical
Publication of CN103092581B publication Critical patent/CN103092581B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a device for setting up a Web front-end local development environment. The method includes: presetting a local proxy server; receiving a webpage access request sent by a client by the local proxy server, wherein the webpage access request contains information of a webpage resource file; judging whether a corresponding file exists in the local proxy server or not according to the information of the webpage resource file; if yes, extracting the corresponding file from the local proxy server; if not, issuing a request for obtaining the corresponding file to a content distribution network (CDN) server and receiving the corresponding file returned from the CDN server by the local proxy server; and when the corresponding file is multiple, combining prior to returning the obtained files by the local proxy server. By the method and the device, complexity of front-end code release online operations can be lowered, development efficiency can be improved, and risks for developing and modifying debug files can be lowered.

Description

Building method and the device of the local development environment of a kind of Web front end
Technical field
The application relates to the technical field that local development environment is built, and particularly relates to the building method of the local development environment of a kind of Web front end, and the local development environment of a kind of Web front end build device.
Background technology
In Website development and operational process, need to build Web front end development environment to the project development of website, in-problem content is modified and debugged.In prior art, Web front end development environment usually needs to use CDN (content distributing network) server, particularly, can attach a lot of resource files of access during normal accessed web page, such as css, js file, the CDN server is exactly the server of depositing these css and js file, the CDN server has the function of Piece file mergence output, so by after the CDN server, the resource file of subsidiary access can be merged into a URL (Uniform Resource Locator, URL(uniform resource locator), i.e. web page address) output.
For example, for similar http://a.tbcdn.cn/? a.js, b.js, the URL of c.js, the CDN server can be with a.js wherein, and b.js and c.js merge into a URL output, and so just need not initiate three requests and obtain respectively these three files,
Or as, access this URL:
Http:// a.tbcdn.cn/? s/kissy/1.1.6/kissy-min.js, p/global/1.0/global-min.js, the result that obtains is exactly the result after kissy-min.js and these two Piece file mergences of global-min.js.The function of this Piece file mergence output of CDN server is known as " combo ".
Web front end Developmental Engineer is in each project development process to the website, in-problem content is modified and debugged all to need associated documents are uploaded on the CDN server and debug and test, because operation all needs to complete on the CDN server, if the newly-increased function of project, source file to be modified may exist on the CDN server, the source file of uploading like this on new file covering CDN server certainly will cause a lot of risks, moreover, it is very complicated that the front end code is issued the operation of reaching the standard grade, the Web front end Developmental Engineer operation of environment on line is very inconvenient, not only can not solve all modification debugging problems, also extremely affect development efficiency.
Therefore, the problem that present those skilled in the art are badly in need of solving is: thus alleviate the complexity that the issue of front end code is reached the standard grade and operated, improve development efficiency, and reduce the risk of developing and revising debugging file.
Summary of the invention
The application's technical matters to be solved is to provide the building method of the local development environment of a kind of Web front end, issues the complexity of the operation of reaching the standard grade in order to alleviate the front end code, improves development efficiency, and reduces the risk of exploitation and modification debugging file.
The application also provides the device of building of the local development environment of a kind of Web front end, in order to guarantee said method application and realization in practice.
In order to address the above problem, the embodiment of the present application discloses the building method of the local development environment of a kind of Web front end, comprising:
Preset local proxy server;
Receive by described local proxy server the web access requests that client sends, comprise the information of web page resources file in described web access requests;
According to the information of described web page resources file, whether judgement exists corresponding file in described local proxy server;
If extract corresponding file from local proxy server;
If not, described local proxy server is initiated the request of obtaining of respective file to content distributing network CDN server, and receives the respective file that described content distributing network CDN server returns;
Return to client after described file has when a plurality of, merges by described local proxy server the file that obtains.
Preferably, described method also comprises:
When described file is one, directly will return to client after the file that obtain by described local proxy server.
Preferably, comprise the information of a plurality of web page resources files in described web access requests, described method also comprises:
The described corresponding document that extracts from local proxy server is write in default buffer memory;
And/or, the respective file of returning from content distributing network CDN server that receives is write default buffer memory;
The described step of returning to client after the file obtain that merged by local proxy server further comprises:
Local proxy server merges the file in described preset buffer memory;
File after merging is returned to client.
Preferably, the step of the file in the described preset buffer memory of described local proxy server merging further comprises:
Judge whether the file in described preset buffer memory comprises the compression obfuscated codes;
If described compression obfuscated codes is converted to and carries out again the Piece file mergence operation after source code;
If not, directly carry out the Piece file mergence operation.
Preferably, described Piece file mergence is operating as and uses the script PHP that embeds hypertext markup language document to complete by the mode that merges character string.
Preferably, in described method, local proxy server uses web server software Apache to build.
Preferably, comprise the information of a web page resources file in described web access requests, before the step of the respective file that the described content distributing network CDN server of described local proxy server reception returns, described method also comprises:
The redirected Rewrite rule of content distributing network CDN server by web server software Apache is redirected to the target web address with the request of described file, from the corresponding file of described target web address extraction, and described file is returned to local proxy server.
Preferably, comprise the information of a plurality of web page resources files in described web access requests, before the step of the respective file that the described content distributing network CDN server of described local proxy server reception returns, described method also comprises:
Content distributing network CDN server extracts the file of asking by built-in function file (), and described file is returned to local proxy server.
The embodiment of the present application also discloses the device of building of the local development environment of a kind of Web front end, comprising:
Local proxy server arranges module: be used for presetting local proxy server;
Web access requests receiver module: be used for receiving by described local proxy server the web access requests that client sends, comprise the information of web page resources file in described web access requests;
Document location judge module: be used for whether having corresponding file according to the information judgement of described web page resources file at described local proxy server; If call local extraction module; If not, call acquisition module and file receiver module on line;
Local extraction module: be used for extracting corresponding file from local proxy server;
Acquisition module on line: be used for described local proxy server and initiate the request of obtaining of respective file to content distributing network CDN server;
File receiver module: be used for receiving the respective file that described content distributing network CDN server returns;
Piece file mergence output module: be used for having when a plurality of at described file, return to client after merging by described local proxy server the file that obtains.
Preferably, described device also comprises:
File output module: be used for directly will returning to client after the file that obtain by described local proxy server when described file is one.
Compared with prior art, the application has the following advantages:
The application builds local development environment by presetting local proxy server simulation CDN server, and described local development environment can be realized crawl and the merging of file on local file and line, and amalgamation result is returned to client in the lump.Make Web front end Developmental Engineer can seamlessly use local development environment to carry out exploitation and the debugging of project, do not debug and test on the CDN server and do not need to upload at every turn, project is until test is arrived the CDN server by rear ability is disposable with File Upload, thereby alleviated the complexity that the issue of front end code is reached the standard grade and operated, improve development efficiency, and reduced the risk of exploitation and modification debugging file.
The application also uses PHP to be used for this locality crawl and the strange land crawl of a plurality of files by Agent; Use built-in function file () grasps the file on the CDN server.Crawl when having realized a plurality of file, and file time crawl on local file and line.Thereby facilitated the operation of exploitation debugging, improved the efficient of exploitation debugging.
Description of drawings
Fig. 1 is the flow chart of steps of building method embodiment 1 of the application's the local development environment of a kind of Web front end;
Fig. 2 is the flow chart of steps of building method embodiment 2 of the application's the local development environment of a kind of Web front end;
Fig. 3 is the flow chart of steps of building method embodiment 3 of the application's the local development environment of a kind of Web front end;
Fig. 4 is the structure flow chart of building device of the application's the local development environment of a kind of Web front end.
Embodiment
For above-mentioned purpose, the feature and advantage that make the application can become apparent more, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
The inventor herein notices, in the prior art, the CDN server that the development environment of Web front end depends on line is realized, yet in practice, Web front end Developmental Engineer development project can not be revised debugging at every turn and all file be passed on the CDN server, and preferably revise debug-item in this locality until there is no bug (leak), more in the lump resource file (css/js file) is published on the CDN server.Therefore, one of core idea of the application is: the function of simulation CDN server is built the local development environment of Web front end.
The application builds local development environment by presetting local proxy server simulation CDN server, and described local development environment can be realized crawl and the merging of file on local file and line, and amalgamation result is returned to client in the lump.Use the embodiment of the present application, Web front end Developmental Engineer can seamlessly use local development environment to carry out exploitation and the debugging of project, do not debug and test on the CDN server and do not need to upload at every turn, project is until test is arrived the CDN server by rear ability is disposable with File Upload, thereby alleviated the complexity that the issue of front end code is reached the standard grade and operated, improve development efficiency, and reduced the risk of exploitation and modification debugging file.
With reference to figure 1, the flow chart of steps of building method embodiment 1 that it shows the application's the local development environment of a kind of Web front end comprises:
Step 101 presets local proxy server;
In the embodiment of the present application, by being set, builds local proxy server the local development environment of Web front end, in specific implementation, described local proxy server can use Apache (web server software) to arrange, and namely described local proxy server can be a small server using apache to build.
In concrete project development, can with host (main frame) address configuration to local, such as a.tbcdn.cn 127.0.0.1, so just can use local development environment as environment on using line.
Step 102 receives by described local proxy server the web access requests that client sends, and comprises the information of a plurality of web page resources files in described web access requests;
After configuring local development environment, the web access requests that client is initiated to comprise a plurality of web page resources fileinfos is to local proxy server, and described web access requests is a URL normally, as: http://cdn/? a.js, b.js; In this case, described web page resources fileinfo normally is included in the filename in URL, the as above a.js in example and b.js.
As the concrete a kind of example used of the embodiment of the present application; for the web access requests that comprises a plurality of web page resources fileinfos; usually can include in its URL symbol " " that is to say; include in URL symbol " " the time; just represent to include in web access requests a plurality of web page resources fileinfos, in this case, can open the function of the Piece file mergence output (combo) of local proxy server.
Step 103, according to the information of described web page resources file, whether judgement exists corresponding file in described local proxy server; If execution in step 104; If not, execution in step 105;
After local proxy server receives the URL of web access requests, at first the URL of this request is analyzed, obtained the information of a plurality of web page resources files that wherein comprise, acquisition will merge the listed files of output.
For each file in described listed files, at first local proxy server judges in this locality whether corresponding document exists.Be specifically as follows, search whether there is corresponding file by the filename of each file in described local proxy server.
Step 104 is extracted corresponding file from local proxy server;
For each file in described listed files, if local proxy server exists at this locality judgement corresponding document, directly extract this document from this locality.
Step 105, described local proxy server are initiated the request of obtaining of respective file to the CDN server, and receive the respective file that described CDN server returns;
In specific implementation, when not having the file that to ask in judging described local proxy server, initiated the request of obtaining of respective file to the CDN server by local proxy server, after the CDN server receives this request, can extract the file of asking by built-in function file (), and described file is returned to local proxy server.Local proxy server receives the respective file that described CDN server returns.
Step 106 is returned to client after described file has when a plurality of, merges by described local proxy server the file that obtains.
As the concrete a kind of example used of the embodiment of the present application, described Piece file mergence operation can use PHP (embedding the script of hypertext markup language document) to complete by the mode that merges character string.
For making those skilled in the art understand better the present embodiment, below further illustrate by a concrete example:
1) use Apache to build local proxy server.
2) local proxy server receives URL and is Http:// a.tbcdn.cn/? a.js, b.js, c.jsWeb access requests, wherein comprise a.js, three web page resources filenames of b.js and c.js.
3) inquire about a.js in local proxy server, three web page resources files of b.js and c.js obtain file c.js, so extraction document c.js; Judge in local proxy server through inquiry and do not have file a.js and b.js.
4) local proxy server is initiated the request of obtaining of a.js and b.js file to the CDN server, and the CDN server grasps a.js and b.js file on line by built-in function file (), and these two files are returned to local proxy server.
5) local proxy server is with a.js, and three files of b.js and c.js merge according to the order of sequence, and the result that then merging is obtained is returned to client.
Certainly, only as a kind of example, those skilled in the art can pass through the said method principle to above-described embodiment, make more variation, as adopt other any method to determine the information of web-page requests; And, adopt other any method to redirect the non-existent file of request home server, the conversion that all is based on the application is used, and the application need not this is limited.
With reference to figure 2, the flow chart of steps of building method embodiment 2 that it shows the application's the local development environment of a kind of Web front end specifically can comprise the steps:
Step 201 presets local proxy server;
Step 202 receives by described local proxy server the web access requests that client sends, and comprises the information of a web page resources file in described web access requests;
After configuring local development environment, the web access requests that client is initiated to comprise a web page resources fileinfo is to local proxy server, and described web access requests is a URL normally, as: http://cdn/a.js; In this case, described web page resources fileinfo normally is included in the filename in URL, the as above a.js in example.
As the concrete a kind of example used of the embodiment of the present application, for the web access requests that comprises a web page resources fileinfo, usually can not include in its URL symbol " " that is to say, do not include in URL symbol " " the time, what just represent to comprise in web access requests is a web page resources fileinfo, in this case, can open the function of the Piece file mergence output (combo) of local proxy server.
Step 203, whether judgement exists corresponding file in described local proxy server according to the information of described web page resources file; If execution in step 204, if not, execution in step 205;
After local proxy server receives the URL of web access requests, at first the URL of this request analyzed, obtained the information of a web page resources file that wherein comprises.
For described file, at first local proxy server judges in this locality whether this document exists.Be specifically as follows, search whether there is this document by the filename of this document in described local proxy server.
Step 204 is extracted corresponding file from local proxy server;
If the file that local proxy server is asked in this locality judgement exists, directly extract this document from this locality.
Step 205, local proxy server are initiated the request of obtaining of respective file to the CDN server, and receive the respective file that described CDN server returns;
In specific implementation, when not having the file that to ask in judging described local proxy server, initiated the request of obtaining of respective file to the CDN server by local proxy server, after the CDN server receives this request, redirected Rewrite rule by Apache is redirected to target URL with the request of described file, extract corresponding file from described target URL, and described file is returned to local proxy server, local proxy server receives the respective file that described CDN server returns.
Step 206 directly will be returned to client after the file that obtain by described local proxy server.
For making those skilled in the art understand better the present embodiment, below further illustrate by a concrete example:
1) use Apache to build local proxy server.
2) local proxy server receives URL and is Http:// a.tbcdn.cn/a.jsWeb access requests, wherein comprise web page resources filename of a.js.
3) this web page resources filename of inquiry a.js in local proxy server, if obtain file a.js, carry out 4); If there is not file a.js, carry out 5).
4) direct extraction document a.js from local proxy server; The result of file a.js is returned to client.
5) complete crawl to file a.js by directly the request of Single document is redirected to target URL by Apache on the CDN server, the result that obtains file a.js is returned to client.
With reference to figure 3, the flow chart of steps of building method embodiment 3 that it shows the application's the local development environment of a kind of Web front end comprises:
Step 301 presets local proxy server;
Step 302, described local proxy server receives the web access requests that client sends, and the information that judge the web page resources file that comprises in described web access requests is one or is a plurality of, if one, execution in step 303 is to step 306; If a plurality of, execution in step 307 is to step 314;
Step 303, whether judgement exists this document in described local proxy server according to the information of described single web page resources file; If execution in step 304, if not, execution in step 305;
Step 304 is extracted the local file that exists from local proxy server;
Step 305, local proxy server are initiated the request of obtaining of described file to the CDN server, and receive the file that described CDN server returns;
Step 306, local proxy server returns to client with the file that obtains.
Step 307 is according to the Information generation listed files of described a plurality of web page resources files;
Step 308, the newly-built buffer memory of local proxy server;
Step 309, for each file in described listed files, whether judgement exists in described local proxy server, if carry out 310; If not, carry out 311;
Step 310 is extracted the local corresponding file that exists from local proxy server, write in default buffer memory;
Step 311, local proxy server are initiated the request of obtaining of described respective file to the CDN server, and receive the respective file that described CDN server returns, and the respective file that receives is write in default buffer memory;
Step 312 judges whether the file in described preset buffer memory comprises the compression obfuscated codes, if execution in step 313; If not, execution in step 314;
Step 313 is converted to described compression obfuscated codes and carries out the Piece file mergence operation after source code again, and the file after merging is returned to client.
Step 314, local proxy server directly merge the file in described preset buffer memory, and the file after merging is returned to client.
In specific embodiment, be converted to the processing of source code for described compression obfuscated codes, local proxy server can provide two kinds of methods to do the expansion of source code, first method depends on the agreement of standard, the filename of the source code of the code after all are obscured is named according to uniform rules (such as " min "), directly searches corresponding with it source file during output; Another method is to introduce beautifier module (a kind of application module in network development) in PHP, in order to realize the expansion of obfuscated codes by code logic, usually second method efficient is very low, and acquiescence is not opened, and needs when being necessary manually opened.
In order to facilitate those skilled in the art to understand better the application, below illustrate further the application by a complete example:
1) use Apache to build local proxy server.
2) local proxy server receives the web access requests of URL; Is this URL http://a.tbcdn.cn/? s/kissy-min.js, p/1.01/global-min.js wherein comprises two web page resources filenames of kissy-min.js and global-min.js.
3) inquiry kissy-min.js and two web page resources filenames of global-min.js in local proxy server; 3 kinds of situations generally can appear this time:
In local proxy server, two files of kissy-min.js and global-min.js all exist;
In local proxy server, two files of kissy-min.js and global-min.js only have one of them existence;
In local proxy server, two files of kissy-min.js and global-min.js do not exist.
4) if in local proxy server, kissy-min.js and two files of global-min.js all exist, directly extract the local corresponding file that exists from local proxy server; Use PHP to complete by local proxy server.
If in local proxy server, two files of kissy-min.js and global-min.js only have one of them to exist, that file that exists directly extracts from local proxy server; Use PHP to complete by local proxy server.Non-existent that file is initiated the request of obtaining of the non-existent file in described this locality to the CDN server by local proxy server, and receive the respective file that described CDN server returns; Complete by directly the request of Single document is redirected to other web page addresses by Apache on content distributing network.
In local proxy server, two files of kissy-min.js and global-min.js do not exist.Initiated the request of obtaining of described two files by local proxy server to the CDN server, and receive the respective file that described CDN server returns; Pass through crawl a plurality of corresponding files of asking on built-in function file () line by content distributing network CDN server, and described file is returned to local proxy server.
5) will be from local proxy server, and/or the kissy-min.js that obtains from the CDN server and two files of global-min.js are all write the buffer memory that the people presets.
6) local proxy server uses in PHP and by the mode that merges character string, kissy-min.js in buffer memory and two files of global-min.js is merged according to the order of sequence, find that its File kissy-min.js is the compression obfuscated codes, after being converted into source code, file kissy-min.js and global-min.js are merged, the result that then merging is obtained is returned to client again.
Need to prove, for embodiment of the method, for simple description, therefore it all is expressed as a series of combination of actions, but those skilled in the art should know, the application is not subjected to the restriction of described sequence of movement, because according to the application, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in instructions all belongs to preferred embodiment, and related action might not be that the application is necessary.
With reference to figure 4, the structure flow chart of building device that it shows the local development environment of a kind of Web front end comprises:
Local proxy server arranges module 401, is used for presetting local proxy server;
Web access requests receiver module 402 is used for receiving by described local proxy server the web access requests that client sends, and comprises the information of web page resources file in described web access requests;
Document location judge module 403 is used for whether having corresponding file according to the information judgement of described web page resources file at described local proxy server; If call local extraction module 404; If not, call acquisition module and file receiver module 405 on line;
Local extraction module 404 is used for extracting corresponding file from local proxy server;
On line, acquisition module 405, are used for described local proxy server and initiate the request of obtaining of respective file to content distributing network CDN server;
File receiver module 406 is used for receiving the respective file that described content distributing network CDN server returns;
Piece file mergence output module 407 is used for having when a plurality of at described file, returns to client after merging by described local proxy server the file that obtains.
In specific implementation, the embodiment of the present application can also comprise:
The file output module is used for directly will returning to client after the file that obtain by described local proxy server when described file is one.
In a preferred embodiment of the present application, can comprise the information of a plurality of web page resources files in described web access requests, the embodiment of the present application can also comprise with lower module:
The first buffer memory writing module is used for the described corresponding document that extracts from local proxy server is write default buffer memory;
And/or,
The second buffer memory writing module is used for the respective file of returning from content distributing network CDN server that receives is write default buffer memory;
In this case, described Piece file mergence output module may further include following submodule:
The Piece file mergence submodule is used for the file that local proxy server merges described preset buffer memory;
File returns to submodule, and the file after being used for merging returns to client.
More preferably, described Piece file mergence submodule may further include with lower unit:
The code judging unit is used for judging whether the file of described preset buffer memory comprises the compression obfuscated codes; If call the transcode unit; If not, call direct merge cells;
The code conversion unit is used for described compression obfuscated codes is converted to source code;
Directly merge cells, be used for directly carrying out the Piece file mergence operation.
As a kind of preferred exemplary of the embodiment of the present application, can comprise the information of a web page resources file in described web access requests, in this case, the embodiment of the present application can also also comprise:
Be positioned at the redirection module of content distributing network CDN server, the redirected Rewrite rule that is used for by web server software Apache is redirected to the target web address with the request of described file, from the corresponding file of described target web address extraction.
As the another kind of preferred exemplary of the embodiment of the present application, can comprise the information of a plurality of web page resources files in described web access requests, in this case, the embodiment of the present application can also comprise:
Be positioned at the built-in function extraction module of content distributing network CDN server, be used for content distributing network CDN server and extract the file of asking by built-in function file (), and described file is returned to local proxy server.
In specific implementation, described system embodiment can be arranged in a certain station server, or is arranged on according to actual conditions in the server cluster of distributed frame, and the application is not restricted this.
Due to described system embodiment substantially corresponding to preceding method embodiment, therefore not detailed part in the description of the present embodiment, can be referring to the related description in previous embodiment, just do not given unnecessary details at this.
The application can be used in numerous general or special purpose computingasystem environment or configuration.For example: personal computer, server computer, handheld device or portable set, plate equipment, multicomputer system, the system based on microprocessor, set top box, programmable consumer-elcetronics devices, network PC, small-size computer, mainframe computer, comprise distributed computing environment of above any system or equipment etc.
The application can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract data type, program, object, assembly, data structure etc.Also can put into practice the application in distributed computing environment, in these distributed computing environment, be executed the task by the teleprocessing equipment that is connected by communication network.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
The building method of the above local development environment of a kind of Web front end that the application is provided and the device of building of the local development environment of a kind of Web front end are described in detail, used specific case herein the application's principle and embodiment are set forth, the explanation of above embodiment just is used for helping to understand the application's method and core concept thereof; Simultaneously, for one of ordinary skill in the art, the thought according to the application all will change in specific embodiments and applications, and in sum, this description should not be construed as the restriction to the application.

Claims (10)

1. the building method of the local development environment of Web front end, is characterized in that, comprising:
Preset local proxy server;
Receive by described local proxy server the web access requests that client sends, comprise the information of web page resources file in described web access requests;
According to the information of described web page resources file, whether judgement exists corresponding file in described local proxy server;
If extract corresponding file from local proxy server;
If not, described local proxy server is initiated the request of obtaining of respective file to content distributing network CDN server, and receives the respective file that described content distributing network CDN server returns;
Return to client after described file has when a plurality of, merges by described local proxy server the file that obtains.
2. the method for claim 1, is characterized in that, also comprises:
When described file is one, directly will return to client after the file that obtain by described local proxy server.
3. method as claimed in claim 1 or 2, is characterized in that, comprises the information of a plurality of web page resources files in described web access requests, and described method also comprises:
The described corresponding document that extracts from local proxy server is write in default buffer memory;
And/or, the respective file of returning from content distributing network CDN server that receives is write default buffer memory;
The described step of returning to client after the file obtain that merged by local proxy server further comprises:
Local proxy server merges the file in described preset buffer memory;
File after merging is returned to client.
4. method as claimed in claim 3, is characterized in that, the step that described local proxy server merges the file in described preset buffer memory further comprises:
Judge whether the file in described preset buffer memory comprises the compression obfuscated codes;
If described compression obfuscated codes is converted to and carries out again the Piece file mergence operation after source code;
If not, directly carry out the Piece file mergence operation.
5. method as claimed in claim 4, is characterized in that, described Piece file mergence is operating as and uses the script PHP that embeds hypertext markup language document to complete by the mode that merges character string.
6. method as claimed in claim 1 or 2, is characterized in that, described local proxy server uses web server software Apache to build.
7. method as claimed in claim 2, it is characterized in that, comprise the information of a web page resources file in described web access requests, before the step of the respective file that the described content distributing network CDN server of described local proxy server reception returns, described method also comprises:
The redirected Rewrite rule of content distributing network CDN server by web server software Apache is redirected to the target web address with the request of described file, from the corresponding file of described target web address extraction, and described file is returned to local proxy server.
8. the method for claim 1, it is characterized in that, comprise the information of a plurality of web page resources files in described web access requests, before the step of the respective file that the described content distributing network CDN server of described local proxy server reception returns, described method also comprises:
Content distributing network CDN server extracts the file of asking by built-in function file (), and described file is returned to local proxy server.
The local development environment of a Web front end build device, it is characterized in that, comprising:
Local proxy server arranges module: be used for presetting local proxy server;
Web access requests receiver module: be used for receiving by described local proxy server the web access requests that client sends, comprise the information of web page resources file in described web access requests;
Document location judge module: be used for whether having corresponding file according to the information judgement of described web page resources file at described local proxy server; If call local extraction module; If not, call acquisition module and file receiver module on line;
Local extraction module: be used for extracting corresponding file from local proxy server;
Acquisition module on line: be used for described local proxy server and initiate the request of obtaining of respective file to content distributing network CDN server;
File receiver module: be used for receiving the respective file that described content distributing network CDN server returns;
Piece file mergence output module: be used for having when a plurality of at described file, return to client after merging by described local proxy server the file that obtains.
10. device as claimed in claim 9, is characterized in that, also comprises:
File output module: be used for directly will returning to client after the file that obtain by described local proxy server when described file is one.
CN201110336122.4A 2011-10-28 2011-10-28 The building method of a kind of web front end this locality development environment and device Active CN103092581B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201110336122.4A CN103092581B (en) 2011-10-28 2011-10-28 The building method of a kind of web front end this locality development environment and device
HK13107467.4A HK1180406A1 (en) 2011-10-28 2013-06-26 Method and device for establishing a web front end local development environment web

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110336122.4A CN103092581B (en) 2011-10-28 2011-10-28 The building method of a kind of web front end this locality development environment and device

Publications (2)

Publication Number Publication Date
CN103092581A true CN103092581A (en) 2013-05-08
CN103092581B CN103092581B (en) 2016-06-08

Family

ID=48205198

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110336122.4A Active CN103092581B (en) 2011-10-28 2011-10-28 The building method of a kind of web front end this locality development environment and device

Country Status (2)

Country Link
CN (1) CN103092581B (en)
HK (1) HK1180406A1 (en)

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473431A (en) * 2013-09-25 2013-12-25 北京大学 Lightweight method for debugging hypertext preprocessor (PHP) program on line
CN103488527A (en) * 2013-09-03 2014-01-01 新浪网技术(中国)有限公司 PHP (hypertext preprocessor) API (application programing interface) calling method, related equipment and system
CN104283947A (en) * 2014-09-28 2015-01-14 深圳市中科无软件有限公司 Java script dynamic consolidated server and work process thereof
CN104506641A (en) * 2014-12-30 2015-04-08 百度在线网络技术(北京)有限公司 Webpage application program access method and device
CN105100148A (en) * 2014-05-09 2015-11-25 腾讯科技(北京)有限公司 File acquiring method of browser and agent server
CN105404504A (en) * 2015-11-02 2016-03-16 北京锐安科技有限公司 Debugging method and device of Web assembly
CN105812839A (en) * 2014-12-31 2016-07-27 华为技术有限公司 Video stream data acquisition method, page data transmission method, system and network server
CN105824614A (en) * 2015-12-15 2016-08-03 广东亿迅科技有限公司 Building method and device for distributed development environment based on Docker
CN105847309A (en) * 2015-01-12 2016-08-10 阿里巴巴集团控股有限公司 Network request processing method and device
CN105897754A (en) * 2016-06-03 2016-08-24 腾讯科技(深圳)有限公司 Data processing system, data pulling method and client
CN107450927A (en) * 2017-08-02 2017-12-08 郑州云海信息技术有限公司 A kind of front-end business provides method and apparatus
CN108337327A (en) * 2018-04-26 2018-07-27 拉扎斯网络科技(上海)有限公司 A kind of resource acquiring method and proxy server
CN108536489A (en) * 2018-04-23 2018-09-14 腾讯科技(深圳)有限公司 Match the method, apparatus and computer readable storage medium of resource environment
CN108989362A (en) * 2017-05-31 2018-12-11 北京京东尚科信息技术有限公司 A kind for the treatment of method and apparatus of static resource
CN109218762A (en) * 2018-09-06 2019-01-15 百度在线网络技术(北京)有限公司 Multimedia resource playback method, device, computer equipment and storage medium
CN109617977A (en) * 2018-12-24 2019-04-12 北京神州绿盟信息安全科技股份有限公司 A kind of web-page requests processing method and processing device
CN109831361A (en) * 2019-02-28 2019-05-31 东软集团股份有限公司 A kind of distributed debugging method, system and device
CN109857391A (en) * 2019-01-18 2019-06-07 山石网科通信技术股份有限公司 Processing method and processing device, storage medium and the electronic device of data
CN110032364A (en) * 2019-04-11 2019-07-19 上海商汤智能科技有限公司 Data processing method, device, electronic equipment and computer storage medium
CN111245914A (en) * 2020-01-06 2020-06-05 北京松果电子有限公司 Analog communication method and device of terminal equipment and storage medium
CN111736926A (en) * 2020-05-29 2020-10-02 北京慧博科技有限公司 Method and system for using CDN acceleration service in Java Web program in low-intrusion mode
CN112235375A (en) * 2020-09-30 2021-01-15 浪潮云信息技术股份公司 Method and device for processing request of WEB front end using Axios resource
CN112597019A (en) * 2020-12-24 2021-04-02 上海艾融软件股份有限公司 Front-end code debugging method, device, system and medium
CN114221953A (en) * 2021-11-29 2022-03-22 平安证券股份有限公司 Resource acquisition method, device, equipment and storage medium
CN114760355A (en) * 2022-03-18 2022-07-15 麒麟软件有限公司 Js-dependent offline management method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174428A1 (en) * 2001-08-01 2007-07-26 Actona Technologies Ltd. Double-proxy remote data access system
CN101242422A (en) * 2007-02-06 2008-08-13 中国电信股份有限公司 Content distribution network system and method applicable to multi-service fusion
CN101763357A (en) * 2008-11-13 2010-06-30 北京搜狗科技发展有限公司 Method and system for browser to load internet resources

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070174428A1 (en) * 2001-08-01 2007-07-26 Actona Technologies Ltd. Double-proxy remote data access system
CN101242422A (en) * 2007-02-06 2008-08-13 中国电信股份有限公司 Content distribution network system and method applicable to multi-service fusion
CN101763357A (en) * 2008-11-13 2010-06-30 北京搜狗科技发展有限公司 Method and system for browser to load internet resources

Cited By (38)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488527A (en) * 2013-09-03 2014-01-01 新浪网技术(中国)有限公司 PHP (hypertext preprocessor) API (application programing interface) calling method, related equipment and system
CN103473431A (en) * 2013-09-25 2013-12-25 北京大学 Lightweight method for debugging hypertext preprocessor (PHP) program on line
CN103473431B (en) * 2013-09-25 2016-12-07 北京大学 A kind of method of the on-line debugging PHP program of lightweight
CN105100148A (en) * 2014-05-09 2015-11-25 腾讯科技(北京)有限公司 File acquiring method of browser and agent server
CN105100148B (en) * 2014-05-09 2019-03-26 腾讯科技(北京)有限公司 A kind of browser obtains the method and proxy server of file
CN104283947A (en) * 2014-09-28 2015-01-14 深圳市中科无软件有限公司 Java script dynamic consolidated server and work process thereof
CN104506641B (en) * 2014-12-30 2018-03-06 百度在线网络技术(北京)有限公司 The access method and device of Web page application program
CN104506641A (en) * 2014-12-30 2015-04-08 百度在线网络技术(北京)有限公司 Webpage application program access method and device
CN105812839A (en) * 2014-12-31 2016-07-27 华为技术有限公司 Video stream data acquisition method, page data transmission method, system and network server
CN105812839B (en) * 2014-12-31 2018-12-14 华为技术有限公司 Video stream data acquisition, page data transmission method, system and network server
CN105847309B (en) * 2015-01-12 2019-09-10 阿里巴巴集团控股有限公司 The treating method and apparatus of network request
CN105847309A (en) * 2015-01-12 2016-08-10 阿里巴巴集团控股有限公司 Network request processing method and device
CN105404504A (en) * 2015-11-02 2016-03-16 北京锐安科技有限公司 Debugging method and device of Web assembly
CN105404504B (en) * 2015-11-02 2018-12-25 北京锐安科技有限公司 A kind of adjustment method and device of Web component
CN105824614A (en) * 2015-12-15 2016-08-03 广东亿迅科技有限公司 Building method and device for distributed development environment based on Docker
CN105824614B (en) * 2015-12-15 2019-05-17 广东亿迅科技有限公司 The building method and device of distributed developing environment based on Docker
CN105897754A (en) * 2016-06-03 2016-08-24 腾讯科技(深圳)有限公司 Data processing system, data pulling method and client
CN108989362A (en) * 2017-05-31 2018-12-11 北京京东尚科信息技术有限公司 A kind for the treatment of method and apparatus of static resource
CN107450927A (en) * 2017-08-02 2017-12-08 郑州云海信息技术有限公司 A kind of front-end business provides method and apparatus
CN108536489A (en) * 2018-04-23 2018-09-14 腾讯科技(深圳)有限公司 Match the method, apparatus and computer readable storage medium of resource environment
CN108536489B (en) * 2018-04-23 2022-03-25 腾讯科技(深圳)有限公司 Method, apparatus, and computer-readable storage medium for matching resource environments
CN108337327A (en) * 2018-04-26 2018-07-27 拉扎斯网络科技(上海)有限公司 A kind of resource acquiring method and proxy server
CN109218762A (en) * 2018-09-06 2019-01-15 百度在线网络技术(北京)有限公司 Multimedia resource playback method, device, computer equipment and storage medium
CN109218762B (en) * 2018-09-06 2019-11-26 百度在线网络技术(北京)有限公司 Multimedia resource playback method, device, computer equipment and storage medium
CN109617977A (en) * 2018-12-24 2019-04-12 北京神州绿盟信息安全科技股份有限公司 A kind of web-page requests processing method and processing device
CN109617977B (en) * 2018-12-24 2021-12-03 绿盟科技集团股份有限公司 Webpage request processing method and device
CN109857391A (en) * 2019-01-18 2019-06-07 山石网科通信技术股份有限公司 Processing method and processing device, storage medium and the electronic device of data
CN109831361A (en) * 2019-02-28 2019-05-31 东软集团股份有限公司 A kind of distributed debugging method, system and device
CN110032364A (en) * 2019-04-11 2019-07-19 上海商汤智能科技有限公司 Data processing method, device, electronic equipment and computer storage medium
CN110032364B (en) * 2019-04-11 2023-08-15 上海商汤智能科技有限公司 Data processing method, device, electronic equipment and computer storage medium
CN111245914A (en) * 2020-01-06 2020-06-05 北京松果电子有限公司 Analog communication method and device of terminal equipment and storage medium
CN111245914B (en) * 2020-01-06 2022-07-22 北京小米松果电子有限公司 Analog communication method and device of terminal equipment and storage medium
CN111736926A (en) * 2020-05-29 2020-10-02 北京慧博科技有限公司 Method and system for using CDN acceleration service in Java Web program in low-intrusion mode
CN112235375A (en) * 2020-09-30 2021-01-15 浪潮云信息技术股份公司 Method and device for processing request of WEB front end using Axios resource
CN112597019A (en) * 2020-12-24 2021-04-02 上海艾融软件股份有限公司 Front-end code debugging method, device, system and medium
CN114221953A (en) * 2021-11-29 2022-03-22 平安证券股份有限公司 Resource acquisition method, device, equipment and storage medium
CN114760355A (en) * 2022-03-18 2022-07-15 麒麟软件有限公司 Js-dependent offline management method
CN114760355B (en) * 2022-03-18 2023-09-26 麒麟软件有限公司 Node. Js dependent offline management method

Also Published As

Publication number Publication date
HK1180406A1 (en) 2013-10-18
CN103092581B (en) 2016-06-08

Similar Documents

Publication Publication Date Title
CN103092581B (en) The building method of a kind of web front end this locality development environment and device
US7523223B2 (en) Web control simulators for mobile devices
US10007532B1 (en) Data infrastructure for cross-platform cross-device API inter-connectivity
CN104731589A (en) Automatic generation method and device of user interface (UI)
CN102087577B (en) Location independent execution of user interface operations
CN105122237A (en) Sharing application states
KR20080053293A (en) Initial server-side content rendering for client-script web pages
US20200404046A1 (en) Application Download Method and Apparatus, Application Sending Method and Apparatus, and System
CN108984202B (en) Electronic resource sharing method and device and storage medium
CN103383687A (en) Page processing method and device
CN105607998B (en) A kind of System and method for carrying out embedded software debugging by online mode
CN103064738A (en) Method and system for embedding local application program window into browser in Linux
CN103377064A (en) Page script loading method and page script loading device
CN105608382A (en) Software maintenance method, software problem judgment method and corresponding apparatuses
CN103747074A (en) Mobile monitoring system on basis of Web server
CN109145236A (en) Page file processing method, apparatus and system
CN114036439A (en) Website building method, device, medium and electronic equipment
CN102664952B (en) Method for managing and monitoring embedded equipment cluster
US9571557B2 (en) Script caching method and information processing device utilizing the same
CN113127361A (en) Application program development method and device, electronic equipment and storage medium
CN111723314B (en) Webpage display method and device, electronic equipment and computer readable storage medium
CN101876998B (en) Method and system for editing data
CN113778897B (en) Automatic test method, device and equipment for interface and storage medium
CN103324567B (en) A kind of adjustment method of application engine and debug system
CN111857695A (en) Software project processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1180406

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1180406

Country of ref document: HK