Font Size: a A A

Design And Implementation Of Web Framework Based On Bigpipe And Node.js

Posted on:2019-02-07Degree:MasterType:Thesis
Country:ChinaCandidate:C LiuFull Text:PDF
GTID:2348330545484476Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
With the rapid development of web technology,the content of web pages has been increasing,and the functions of web pages have become richer and more comprehensive.However,the size of web pages HTML and static resources also increases and the generation time of web pages becomes longer,which slows the loading of web pages and lowers the user experience.Server-side rendering and asynchronous generation of Ajax(Asynchronous Javascript and XML)are two of the current mainstream web page loading schema,but in both implementations,the browser and the network are idle until server-side data returns,which means there is obvious optimization space.Bigpipe loading program is an optimization solution to this problem,which is based on the idea of CPU pipeline.The page is divided into multiple pagelets(Pagelet).Whenever the server generates a Pagelet Content,with the block transfer coding will be used to pass the Pagelet to the browser,which making the server,network,browser all work at the same time whithout blocking.Thereby enhancing the efficiency of webpage loading.However,Bigpipe's solution to JavaScript and CSS also needs to be split,resulting in a significant increase in the number of HTTP requests.Node.js is a server-side JavaScript running environment that has emerged in recent years,which performance is outstanding.Meanwhile,there has also emerged more excellent static resource packaging solutions in recent years on Node.js.It's can be received that Node.js platform is suitable for Bigpipe solutions to improve the render performance.In order to utilize Bigpipe to optimize the current webpage loading process and take into account that Bigpipe has many requirements on the programming mode and needs to be implemented in a framework form,this paper proposes a platform based on Node.js to implement the network framework of the parallel Bigpipe scheme,using Node.js platform asynchronous I/O,and event-driven model to enhance parallel Bigpipe execution speed.At the same time,in order to solve the problem that Bigpipe has long been criticized for HTTP requests,the paper proposes the merging of the front-end resources of Pagelet completed before the framework runs,and then completes the front-end resource packaging by means of the WebPack of the package tool of Node.js platform.The amount of front-end resources is greatly reduced.Currently,the front-end resource package used by the industry is packaged before page service running.When there is no page accessing data,the front-end resource package only can be simply assumed to be uniformly distributed among the pages so that the package result is optimized according to the number of times the JavaScript module is referenced by other JavaScript modules.Therefore,considering that the framework possesses runtime(runtime)capabilities and the framework imports a package tool,this thesis proposes that the framework should count the number of accesses to each page at runtime and design a heuristic algorithm for static resource optimization that allows the framework repackaging to optimize the actual use of static resources.After contrasting and verifying,the framework proposed in this thesis improves current loading speed of web pages.Compared with the traditional scheme of unparalleled page data,dynamic packaging of static resources generates obvious optimization effect.In the test case,the framework achieved 18.8%time-saving in page loading and 75.8%less static resource load.
Keywords/Search Tags:page loading, Bigpipe, Node.js, static resource optimization
PDF Full Text Request
Related items