CN106339508A - WEB caching method based on paging - Google Patents

WEB caching method based on paging Download PDF

Info

Publication number
CN106339508A
CN106339508A CN201610933511.8A CN201610933511A CN106339508A CN 106339508 A CN106339508 A CN 106339508A CN 201610933511 A CN201610933511 A CN 201610933511A CN 106339508 A CN106339508 A CN 106339508A
Authority
CN
China
Prior art keywords
page
paging
request
data
pages
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
CN201610933511.8A
Other languages
Chinese (zh)
Other versions
CN106339508B (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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN201610933511.8A priority Critical patent/CN106339508B/en
Publication of CN106339508A publication Critical patent/CN106339508A/en
Application granted granted Critical
Publication of CN106339508B publication Critical patent/CN106339508B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The invention discloses a WEB caching method based on paging. The WEB caching method comprises the steps that during initial loading, requesting the data of former three pages, then obtaining the allowably requested maximum page each by addition of the page requested last time and a counter, and after successful request each time, enabling the largest page number to be as the length of a current page data caching array; when loading a new page, taking the page number of the page as an index subscript, reading the page data caching array, and if the read data is empty, illustrating that the page is not cached, and requesting the page and the adjacent page which is not requested. According to the WEB method, only a small quantity of requests are sponsored to a server, the visit hit rate of caching data is increased, and the page missing rate is reduced, so that the average showing time of a webpage is shortened, and further the user experience is improved.

Description

A kind of web caching method based on paging
Technical field
The invention belongs to database caches technical field, particularly to a kind of web caching method based on paging.
Background technology
Weblication i.e. network application program, user need not install any dedicated program, only with browsing Device carrys out access server, just can realize operation flow by browsing webpage.The rise of internet makes rapid of web application Exhibition, the data volume of web application also increases.For enterprise information system, data volume is without limitation in a small range, If in all desperation all data are returned to user, not only can reduce Consumer's Experience, also can greatly increase server and network Burden.
In order to solve the above problems, paging technique is arisen at the historic moment.Paging technique is that all data sectionals are showed by one kind What the technical user of user was seen every time is not all of data, but a part therein, if do not found wherein Review one's lessons the content oneself wanted, user can change content visible by way of page turning.
It is understood that the presentative time of webpage is to be determined by the response time of website and the load time of website.Paging skill Although art can greatly reduce the burden of server and network, because repeatedly initiating request to server, inherently increase webpage Average response time so that increase the average presentative time of webpage, and the presentative time of webpage will directly influence user's Experience.
It is therefore desirable to designing a kind of requesting method of paging, the operation rule according to user passes through certain algorithm once asks Seeking multiple pages and cache, reducing the number of times initiating request to server, thus reducing the average presentative time of webpage.
Content of the invention
It is an object of the invention to overcoming the deficiencies in the prior art, provide a kind of only initiate a small amount of request to server, Data cached access hit rate just being improved, reduce page fault rate, thus reducing the average presentative time of webpage, and then improving The web caching method based on paging for the Consumer's Experience.
The purpose of the present invention is achieved through the following technical solutions: a kind of web caching method based on paging, including Following steps:
S1, load paging original list first, Web page application program to the data of first three page of server request and will be asked To data buffer storage to browser locally stored in, then load the first page data, and by paging request counter initialize For -1;
The new paging of s2, access, user clicks on the paging menu being numbered n, accesses the data of nth page;Wherein, 1≤n≤ Totalpage, totalpage represent the total page number of paging, i.e. the maximum (last page) of paging menu number label;
S3, judge whether the data of nth page is buffered, if the data of nth page had been buffered, web application The local cache data of routine access browser, paging request counter is added 1, is then back to execution step s2;Otherwise execute Step s4;
S4, nth page data also uncached, the value that the number of pages of last request is added with counter is as this permission Then paging request counter is re-set as -1, first page number and end code are all initialized as by the maximum number of pages of request N, execution step s5;
S5, judge whether the next page of sign-off sheet is buffered, if the next page of sign-off sheet is also uncached, continue to sentence Whether the selected page number that breaks is less than the maximum number of pages allowing request, if it is execution step s6, otherwise execution step s9;As Buffered then execution step s7 of the next page of fruit sign-off sheet;
S6, the selected page number are less than the maximum number of pages allowing request, and sign-off sheet is moved rearwards by one page;Return to step s5;
S7, judge whether the prevpage of start page is buffered, if also uncached, execution step s8, otherwise execute step Rapid s9;
S8, judge that the selected page number, whether less than maximum number of pages totalpage allowing request, if it is will initiate Page moves forward one page, is then back to step s7;Otherwise execution step s9;
S9, the request page between sign-off sheet for the start page simultaneously cache, and return execution step s2.
Further, the described maximum number of pages allowing request is not less than 2.
The invention has the beneficial effects as follows: the present invention, according to the operation rule of user, once asks multiple specific webpage and delays Depositing, reduce the number of times initiating request to server, thus reducing the average presentative time of webpage, and then improving Consumer's Experience;If " adding 1 by paging request counter " in step s3 is performed continuously, and illustrates that this user browses in order, and that is, this user is in order Click on paging menu, then allow the maximum number of pages of request will be gradually increased, the page asked when skipping leaf every time will get more and more, from And reduce page fault rate, reduce the number of times initiating request to server;If " paging request counter being reset in step s4 For -1 " it is performed continuously, illustrate that this user's great-jump-forward browses, that is, this user's great-jump-forward clicks on paging menu, then allow request Maximum number of pages will gradually decrease, and the page asked when skipping leaf every time will be fewer and feweri, thus improving the utilization rate of requested date. In the present invention, increase the page number of request, be the initiation quantity in order to reduce request, thus it is in current for reducing the average of the page Between, and reduce the page number of request, it is the waste in order to avoid flow, using the algorithm of the present invention, only initiate to server few The request of amount, it becomes possible to improve data cached access hit rate, reduces page fault rate, thus it is in current for reducing the average of webpage Between, and then improve Consumer's Experience.
Brief description
Fig. 1 is the web caching method flow chart based on paging of the present invention.
Specific embodiment
Further illustrate technical scheme below in conjunction with the accompanying drawings.
The present invention is a kind of web cache policy based on paging, and request of data mode is based on " paging strategy ", but is different from General " paging strategy ", subscriber's main station is not the paging simply asking fixing number of pages in order successively, but takes solely Number of pages and the page number to determine request for the special algorithm, then will be locally stored in browser for the data buffer storage of request In, and to be ensured data cached ageing using cleverly algorithm.Subscriber's main station according to the operation rule of user, by us The algorithm of original creation, once to the multiple page of server request and cache, so can reduce the number of times initiating request to server, Thus reducing the average presentative time of webpage, and then improve Consumer's Experience.In page request algorithm, subscriber's main station is according to user Operating habit, the data of the individualization request page, that is, the operation behavior of user can affect number of pages and the page number of request data.Just During secondary loading, ask the data of first three page, number of pages and counting that hereafter demandable maximum number of pages is asked each time by the last time Device is added and obtains, and is provided with minimum request number of pages, thus ensureing that request can obtain data every time.In addition ask every time The page must be continuous page block.If evaluation algorithm shows that the operating habit of user is adopting consecutive click chemical reaction paging menu, i.e. user It is to browse in order, then asks ensuing paging, and when skipping leaf every time, increase the page number of request every time.Request number of pages Increase with the increase of the number of times that skips leaf, the probability of situation appearance of skipping leaf can be effectively reduced.Detailed process is as shown in figure 1, one Plant the web caching method based on paging, comprise the following steps:
S1, load paging original list first, Web page application program to the data of first three page of server request and will be asked To data buffer storage to browser locally stored in, then load the first page data, and by paging request counter initialize For -1;
The new paging of s2, access, user clicks on the paging menu being numbered n, accesses the data of nth page;Wherein, 1≤n≤ Totalpage, totalpage represent the total page number of paging, i.e. the maximum (last page) of paging menu number label;
S3, judge whether the data of nth page is buffered, if the data of nth page had been buffered, web application The local cache data of routine access browser, paging request counter is added 1, is then back to execution step s2;Otherwise execute Step s4;
S4, nth page data also uncached, the value that the number of pages of last request is added with counter is as this permission Then paging request counter is re-set as -1, first page number and end code are all initialized as by the maximum number of pages of request N, execution step s5;
S5, judge whether the next page of sign-off sheet is buffered, if the next page of sign-off sheet is also uncached, continue to sentence Whether the selected page number that breaks is less than the maximum number of pages allowing request, if it is execution step s6, otherwise execution step s9;As Buffered then execution step s7 of the next page of fruit sign-off sheet;
S6, the selected page number are less than the maximum number of pages allowing request, and sign-off sheet is moved rearwards by one page;Return to step s5;
S7, judge whether the prevpage of start page is buffered, if also uncached, execution step s8, otherwise execute step Rapid s9;
S8, judge that the selected page number, whether less than maximum number of pages totalpage allowing request, if it is will initiate Page moves forward one page, is then back to step s7;Otherwise execution step s9;
S9, the request page between sign-off sheet for the start page simultaneously cache, and return execution step s2.
Further, the described maximum number of pages allowing request is not less than 2.
The present invention according to the operating habit of user, the data of the individualization request page, that is, the operation behavior of user can affect The number of pages of request data and the page number, and it is provided with minimum request number of pages, thus ensureing that request can obtain data every time.Tool The implementation method of body is to click on number of pages and the page number to arrange request data for the custom of paging menu according to user.First loading When, ask the data of first three page.Hereafter, if evaluation algorithm shows that the operating habit of user is adopting consecutive click chemical reaction paging menu, that is, use Family is to browse in order, then ask ensuing paging, and when skipping leaf every time, increases the page number of request every time.Requested page Number increases with the increase of the number of times that skips leaf, and can effectively reduce the probability of situation appearance of skipping leaf.If in step s3 " by paging Request counter adds 1 " it is performed continuously, illustrate that this user browses in order, that is, this user clicks on paging menu in order, then permit The maximum number of pages being permitted request will be gradually increased, and the page asked when skipping leaf every time will get more and more, thus reducing page fault rate, reduce Initiate the number of times of request to server;If " paging request counter is re-set as -1 " in step s4 is performed continuously, Illustrate that this user's great-jump-forward browses, that is, this user's great-jump-forward clicks on paging menu, then allow the maximum number of pages of request will gradually subtract Few, the page asked when skipping leaf every time will be fewer and feweri, thus improving the utilization rate of requested date.
The present invention using unique algorithm by ask to page data be buffered in browser locally stored in, can Easily line access is entered to page data, and can efficiently judge whether certain page has been buffered.Concrete implementation Mode is the dynamic using array, and after each request success, the highest page number is the length of current page data buffer storage array Degree.When loading a new page, first with the page number of this page for indexing subscript, page data caching array is read out, If the data reading is sky, illustrates that this page is not also buffered, then ask this page and its neighbouring not requested page Face.
The present invention using cleverly algorithm to ensure browser locally stored in data cached ageing.At the beginning of webpage During secondary loading, the page that no matter loads for the first time whether be buffered in browser locally stored in, all initiates one and asks, obtain Take returned data.If not being buffered before this returned data, directly it is cached;If being delayed before this returned data Deposited, then contrasted both last modification times, if last modification time is inconsistent, covered with new data old in browser Data, otherwise, makes no modifications.
Those of ordinary skill in the art will be appreciated that, embodiment described here is to aid in reader and understands this Bright principle is it should be understood that protection scope of the present invention is not limited to such special statement and embodiment.This area Those of ordinary skill can make various other each without departing from present invention essence according to these technology disclosed by the invention enlightenment Plant concrete deformation and combine, these deform and combine still within the scope of the present invention.

Claims (2)

1. a kind of web caching method based on paging is it is characterised in that comprise the following steps:
S1, load paging original list first, request to the data of server request first three page and is arrived by Web page application program Data buffer storage to browser locally stored in, then load the first page data, and paging request counter be initialized as -1;
The new paging of s2, access, user clicks on the paging menu being numbered n, accesses the data of nth page;Wherein, 1≤n≤ Totalpage, totalpage represent the total page number of paging, i.e. the maximum of paging menu number label;
S3, judge whether the data of nth page is buffered, if the data of nth page had been buffered, Web page application program The local cache data of access browser, paging request counter is added 1, is then back to execution step s2;Otherwise execution step s4;
S4, nth page data also uncached, the value that the number of pages of last request is added with counter allows to ask as this Maximum number of pages, then paging request counter is re-set as -1, first page number and end code are all initialized as n, hold Row step s5;
S5, judge whether the next page of sign-off sheet is buffered, if the next page of sign-off sheet is also uncached, continue to judge institute Whether the page number selecting is less than the maximum number of pages allowing request, if it is execution step s6, otherwise execution step s9;If knot Buffered then execution step s7 of the next page of bundle page;
S6, the selected page number are less than the maximum number of pages allowing request, and sign-off sheet is moved rearwards by one page;Return to step s5;
S7, judge whether the prevpage of start page is buffered, if also uncached, execution step s8, otherwise execution step s9;
S8, judge the selected page number whether less than maximum number of pages totalpage allowing request, if it is by start page to Front mobile one page, is then back to step s7;Otherwise execution step s9;
S9, the request page between sign-off sheet for the start page simultaneously cache, and return execution step s2.
2. a kind of web caching method based on paging according to claim 1 it is characterised in that described permission request Maximum number of pages is not less than 2.
CN201610933511.8A 2016-10-25 2016-10-25 WEB caching method based on paging Active CN106339508B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610933511.8A CN106339508B (en) 2016-10-25 2016-10-25 WEB caching method based on paging

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610933511.8A CN106339508B (en) 2016-10-25 2016-10-25 WEB caching method based on paging

Publications (2)

Publication Number Publication Date
CN106339508A true CN106339508A (en) 2017-01-18
CN106339508B CN106339508B (en) 2020-03-17

Family

ID=57840723

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610933511.8A Active CN106339508B (en) 2016-10-25 2016-10-25 WEB caching method based on paging

Country Status (1)

Country Link
CN (1) CN106339508B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220385A (en) * 2017-06-29 2017-09-29 环球智达科技(北京)有限公司 System for exporting the grid page
CN107329676A (en) * 2017-06-29 2017-11-07 环球智达科技(北京)有限公司 Method for exporting the grid page
CN107451227A (en) * 2017-07-21 2017-12-08 网宿科技股份有限公司 Paging query method and device
CN107870875A (en) * 2017-08-09 2018-04-03 成都萌想科技有限责任公司 One kind may customize intelligent data caching method based on distributed memory
CN108632388A (en) * 2018-05-15 2018-10-09 聚好看科技股份有限公司 A kind of loading method and device of paged content
CN111352580A (en) * 2018-12-20 2020-06-30 爱思开海力士有限公司 Storage device and operation method thereof
CN112000904A (en) * 2020-08-25 2020-11-27 杭州迪普科技股份有限公司 Page presenting method and system
CN114816586A (en) * 2022-06-28 2022-07-29 深圳高灯计算机科技有限公司 Visible data loading method and device, computer equipment and storage medium
CN114895971A (en) * 2022-03-23 2022-08-12 深圳市酷开网络科技股份有限公司 Data loading method and device, terminal equipment and medium
US20230083822A1 (en) * 2021-09-16 2023-03-16 International Business Machines Corporation Optimized rendering of web pages

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411585A (en) * 2010-09-21 2012-04-11 厦门市美亚柏科信息股份有限公司 Webpage paging data pre-loading method and system
CN103425708A (en) * 2012-05-25 2013-12-04 金蝶软件(中国)有限公司 Optimized web paging query method and device
CN105205069A (en) * 2014-06-24 2015-12-30 鸿合科技有限公司 Cache opening method and device based on paging file
CN105740330A (en) * 2016-01-22 2016-07-06 腾讯科技(深圳)有限公司 Data paging display method and apparatus
US9454285B1 (en) * 2015-09-22 2016-09-27 International Business Machines Corporation Maintaining continuous access to web content

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102411585A (en) * 2010-09-21 2012-04-11 厦门市美亚柏科信息股份有限公司 Webpage paging data pre-loading method and system
CN103425708A (en) * 2012-05-25 2013-12-04 金蝶软件(中国)有限公司 Optimized web paging query method and device
CN105205069A (en) * 2014-06-24 2015-12-30 鸿合科技有限公司 Cache opening method and device based on paging file
US9454285B1 (en) * 2015-09-22 2016-09-27 International Business Machines Corporation Maintaining continuous access to web content
CN105740330A (en) * 2016-01-22 2016-07-06 腾讯科技(深圳)有限公司 Data paging display method and apparatus

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
齐金刚,等: "Django框架Web数据查询分页技术研究", 《DJANGO框架WEB数据查询分页技术研究》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220385A (en) * 2017-06-29 2017-09-29 环球智达科技(北京)有限公司 System for exporting the grid page
CN107329676A (en) * 2017-06-29 2017-11-07 环球智达科技(北京)有限公司 Method for exporting the grid page
CN107451227A (en) * 2017-07-21 2017-12-08 网宿科技股份有限公司 Paging query method and device
CN107870875A (en) * 2017-08-09 2018-04-03 成都萌想科技有限责任公司 One kind may customize intelligent data caching method based on distributed memory
CN108632388A (en) * 2018-05-15 2018-10-09 聚好看科技股份有限公司 A kind of loading method and device of paged content
CN111352580A (en) * 2018-12-20 2020-06-30 爱思开海力士有限公司 Storage device and operation method thereof
CN111352580B (en) * 2018-12-20 2023-07-21 爱思开海力士有限公司 Memory device and method of operating the same
CN112000904A (en) * 2020-08-25 2020-11-27 杭州迪普科技股份有限公司 Page presenting method and system
US20230083822A1 (en) * 2021-09-16 2023-03-16 International Business Machines Corporation Optimized rendering of web pages
CN114895971A (en) * 2022-03-23 2022-08-12 深圳市酷开网络科技股份有限公司 Data loading method and device, terminal equipment and medium
CN114816586A (en) * 2022-06-28 2022-07-29 深圳高灯计算机科技有限公司 Visible data loading method and device, computer equipment and storage medium
CN114816586B (en) * 2022-06-28 2022-09-27 深圳高灯计算机科技有限公司 Visible data loading method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN106339508B (en) 2020-03-17

Similar Documents

Publication Publication Date Title
CN106339508A (en) WEB caching method based on paging
US10013502B1 (en) Preloading resources of a web page
US8375107B2 (en) Webpage pre-reading method, transfer server and webpage pre-reading system
CN105550338A (en) HTML5 application cache based mobile Web cache optimization method
US20170013072A1 (en) Webpage pre-reading method, apparatus and smart terminal device
CN106815287A (en) A kind of buffer memory management method and device
CN103312733B (en) Information processing method and device
CN103729438A (en) Webpage preloading method and device
CN100395750C (en) Buffer store management method
CN106681990B (en) Data cached forecasting method under a kind of mobile cloud storage environment
JP2001222459A (en) System and method for caching
CN106599239A (en) Webpage content data acquisition method and server
CN103916474B (en) The definite method, apparatus and system of cache-time
CN103617222A (en) Browser and method for preloading in webpages
CN102821113A (en) Cache method and system
Ibrahim et al. Neural nets based predictive prefetching to tolerate WWW latency
CN101739427A (en) Crawler capturing method and device thereof
CN110471939A (en) Data access method, device, computer equipment and storage medium
US11775518B2 (en) Asynchronous predictive caching of content listed in search results
CN106649313A (en) Method and equipment for processing cache data
CN106326261A (en) Pre-reading method and device for webpage and intelligent terminal device
CN103460205B (en) The method and device of Web Pre-Fetching
CN112433784A (en) Page loading method, device, equipment and storage medium
CN104850508B (en) access method based on data locality
CN103442000B (en) WEB caching replacement method and device, http proxy server

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant