Font Size: a A A

Research And Implementation Of An Independent And Efficient Client Cache Solution

Posted on:2022-12-14Degree:MasterType:Thesis
Country:ChinaCandidate:J W YeFull Text:PDF
GTID:2518306773997669Subject:Automation Technology
Abstract/Summary:PDF Full Text Request
With the rapid development of the Internet and the continuous updating of Web technology,client programs are developing towards more complex interaction and larger data volume.In this trend,the load performance of client programs and the response speed of servers are increasingly required.Caching technology allows data requested by clients to be stored locally,thereby reducing the number of requests from the server and reducing server pressure.In order to better solve the various problems encountered in the client cache,a more efficient client cache solution must be designed.Traditional client-side caching solutions are based on browser memory caching and HTTP caching,which have many limitations and cannot meet the growing number of front-end applications.Based on the above problems,this paper makes a deep analysis of the functions,limitations and differences of client-side caching technologies,and finally establishes Cache Storage and Indexed DB as storage warehouses.On this basis,the virtual proxy service is implemented between the client and the server by using Service Worker to intercept requests sent by the client.Requests are divided into precompiled file requests,permanent cache requests,cache-first requests,and no-cache requests.Different types of requests use different caching strategies to determine how data is stored.This separates the cache management function from the client rendering main thread and improves the user experience of front-end applications.In order to package the front-end precompiled files into small size files,achieve more efficient cache incremental updates of precompiled files and reduce the white screen time of pages,this paper implements the sww-cli command line building tool,which executes commands from the command line to run the development and production environment,receives user-passed parameters,simplifies the development process,and implements the sww-template project template.Developers can simply execute commands to download templates locally,eliminating tedious configuration and improving development efficiency.In order to save the client's cache space,the upper limit of cache number is set for cache priority requests.When the cache exceeds the limit,the LRU-FT cache replacement algorithm designed in this paper is used to remove part of the cache.Comparing this algorithm with LRU,LFU and GDSF cache replacement algorithm,it is concluded that LRU-FT is more efficient and practical in front-end applications.Finally,the client-side caching scheme implemented in this paper is tested for its function and performance.This scheme implements the local caching of client data.When users access the page again,the load performance of the page is improved by more than 80%,and the improvement is more obvious in weak network environment.
Keywords/Search Tags:client cache, cache replacement, Webpack, Service Worker
PDF Full Text Request
Related items