CN110727891A - Browser cache management method and device and computer readable storage medium - Google Patents
Browser cache management method and device and computer readable storage medium Download PDFInfo
- Publication number
- CN110727891A CN110727891A CN201910868056.1A CN201910868056A CN110727891A CN 110727891 A CN110727891 A CN 110727891A CN 201910868056 A CN201910868056 A CN 201910868056A CN 110727891 A CN110727891 A CN 110727891A
- Authority
- CN
- China
- Prior art keywords
- request information
- request
- result
- browser
- user
- 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
- 238000007726 management method Methods 0.000 title claims abstract description 44
- 238000005516 engineering process Methods 0.000 claims abstract description 6
- 238000000034 method Methods 0.000 claims description 19
- 238000003780 insertion Methods 0.000 claims description 10
- 230000037431 insertion Effects 0.000 claims description 10
- 230000006870 function Effects 0.000 abstract description 8
- 238000005457 optimization Methods 0.000 abstract description 2
- 230000008569 process Effects 0.000 description 8
- 230000009471 action Effects 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000009877 rendering Methods 0.000 description 4
- 238000010276 construction Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000003068 static effect Effects 0.000 description 3
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006386 memory function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012549 training Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9566—URL specific, e.g. using aliases, detecting broken or misspelled links
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention relates to a computer performance optimization technology, and discloses a browser cache management method, which comprises the following steps: inserting a script code into a webpage standard language file in a browser, receiving request information of a user in the browser, judging whether the request information is common request information or storage request information, calling the webpage standard language file to execute the request information when the request information is the common request information, judging whether a request result of the storage request information exists locally when the request information is the storage request information, if the request result is locally, returning the request result to the user, and if the request result is not locally, downloading the request result based on the script code and a website of the storage request information and returning the request result to the user. The invention also provides a browser cache management device and a computer readable storage medium. The invention can realize the high-efficiency browser cache management function.
Description
Technical Field
The present invention relates to the field of computer performance optimization technologies, and in particular, to a method and an apparatus for managing a browser cache, and a computer-readable storage medium.
Background
The browser not only has the function of browsing web pages, but also has the functions of supporting various caches and the like, and at present, two main caching schemes are provided based on the browser: (1) the file name of the resource file is added with the hash value of the file through a construction tool, so that the content of the cache file is ensured to be unchanged, but the browser needs to perform multiple judgment and addition operations on the generated hash value every time, and the construction tool needs to be reused for construction every time of reloading, so that the time and the labor are consumed, and the cache memory function is not realized; (2) the file is accessed using the interface provided by the management plug-in, such as AMD, CMD, etc., and setting the get parameter of the static file load path URL. Although the caching scheme of the method (2) is simple, the file needs to be repeatedly loaded from the server of the file, which causes the problems that the server overhead is increased and the user experience is poor.
Disclosure of Invention
The invention provides a browser cache management method, a browser cache management device and a computer readable storage medium, and mainly aims to perform intelligent operation cache management according to the operation of a user on a browser.
In order to achieve the above object, a browser cache management method provided by the present invention includes:
inserting a pre-constructed script code into a webpage standard language file in a browser;
receiving request information of a user in the browser, and judging whether the request information is common request information or storage request information;
when the request information is the common request information, directly calling the webpage standard language file to execute the request information;
when the request information is the storage request information, judging whether a request result of the storage request information exists locally;
if the request result of the storage request information exists locally, the request result is directly returned to the user;
and if the request result of the storage request information does not exist locally, downloading the request result based on the pre-constructed script code and the website of the storage request information and returning the request result to the user.
Optionally, the inserting the pre-constructed script code into the web page standard language file in the browser includes:
traversing to obtain all external resource tags of the links in the web page standard language file to obtain a tag set of the external resource tags of the links;
traversing the link external resource label set to obtain a link external resource label with a path label, and obtaining an external path label set;
traversing each external path label in the external path label set, and sequentially importing the pre-constructed script code into the path label position of the external path label to complete insertion.
Optionally, if the request information is the common request information, directly invoking the web page standard language file to execute the request information, including:
judging the execution type of the common request information;
and running the corresponding execution code in the webpage standard language file according to the execution type, and returning the execution result of the common request information obtained by running the execution code to the user.
Optionally, the downloading the request result and returning the request result to the user based on the pre-constructed script code and the website storing the request information includes:
extracting a URL link of the storage request information;
placing the URL link in the pre-constructed script code, and operating the pre-constructed script code to access the URL link to obtain the request result;
and storing the request result locally and returning the request result to the user.
Optionally, the running the pre-built script code to access the URL link to obtain the request result includes:
creating a document object model by using the webpage standard language file;
establishing a link external resource tag and a path tag in the document object model based on a dynamic script technology;
and storing the script code containing the URL link into a link external resource label and a path label of the document object model, and operating the document object model to obtain the request result.
In addition, in order to achieve the above object, the present invention further provides a browser cache management apparatus, including a memory and a processor, where the memory stores a browser cache management program operable on the processor, and the browser cache management program implements the following steps when executed by the processor:
inserting a pre-constructed script code into a webpage standard language file in a browser;
receiving request information of a user in the browser, and judging whether the request information is common request information or storage request information;
when the request information is the common request information, directly calling the webpage standard language file to execute the request information;
when the request information is the storage request information, judging whether a request result of the storage request information exists locally;
if the request result of the storage request information exists locally, the request result is directly returned to the user;
and if the request result of the storage request information does not exist locally, downloading the request result based on the pre-constructed script code and the website of the storage request information and returning the request result to the user.
Optionally, the inserting the pre-constructed script code into the web page standard language file in the browser includes:
traversing to obtain all external resource tags of the links in the web page standard language file to obtain a tag set of the external resource tags of the links;
traversing the link external resource label set to obtain a link external resource label with a path label, and obtaining an external path label set;
traversing each external path label in the external path label set, and sequentially importing the pre-constructed script code into the path label position of the external path label to complete insertion.
Optionally, if the request information is the common request information, directly invoking the web page standard language file to execute the request information, including:
judging the execution type of the common request information;
and running the corresponding execution code in the webpage standard language file according to the execution type, and returning the execution result of the common request information obtained by running the execution code to the user.
Optionally, the downloading the request result and returning the request result to the user based on the pre-constructed script code and the website storing the request information includes:
extracting a URL link of the storage request information;
placing the URL link in the pre-constructed script code, and operating the pre-constructed script code to access the URL link to obtain the request result;
and storing the request result locally and returning the request result to the user.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium having a browser cache management program stored thereon, where the browser cache management program is executable by one or more processors to implement the steps of the browser cache management method as described above.
The invention inserts the pre-constructed script code into the webpage standard language file in the browser in advance, is convenient for the whole system to operate only at the webpage end, effectively saves resources, judges whether the request information of the user is common request information or storage request information, and performs different subsequent operations according to different request information, thereby being beneficial to quickly and efficiently responding to the user operation, particularly downloading and storing the request information according to the pre-constructed script code when storing the request information, being convenient for the next request operation and saving a large amount of resources. Therefore, the browser cache management method, the browser cache management device and the computer readable storage medium can realize fast and efficient cache management.
Drawings
Fig. 1 is a schematic flowchart of a browser cache management method according to an embodiment of the present invention;
fig. 2 is a schematic internal structural diagram of a browser cache management apparatus according to an embodiment of the present invention;
fig. 3 is a schematic block diagram of a browser cache management program in a browser cache management device according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides a browser cache management method. Fig. 1 is a schematic flowchart of a browser cache management method according to an embodiment of the present invention. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the browser cache management method includes:
and S1, inserting the pre-constructed script code into the webpage standard language file.
Preferably, the pre-constructed script code is written based on a programming language such as Javascript. The script code is inserted into the web page standard language file to perform relevant operations according to the specific actions performed by the user, such as: when a user clicks a picture A when accessing a webpage, the script code detects the clicking action of the user and then accesses a URL link (the URL link is also called a uniform resource locator and is a concise expression of the position and the access method of a resource which can be obtained from the Internet) of the picture A, and requests a remote server for the picture AOriginal picture A of A1(typically, the original picture is more sharp relative to the picture on the page), and the original picture A is taken1And downloading to a local browser for viewing. The series of operations, called static file cache, which stores the file requested by the user on the local computer, is all performed by the pre-built script code. The files include pictures, links, even music, programs, etc.
Preferably, the web page standard language file is a necessary web page browsing file based on hypertext markup language (such as HTML and CSS), is a basis for a browser to access a web page, can provide functions such as a web page display position, a web page scaling, formatting, refreshing and the like, and can operate elements of the web page, such as a web page font size, web page picture browsing and the like.
Preferably, the inserting comprises: traversing all the link external resource tags in the web page standard language file to obtain a link external resource tag set, traversing the link external resource tags with path tags from the link external resource tag set to obtain an external path tag set, traversing each external path tag of the external path tag set, and sequentially inserting the pre-constructed script code into the path tag position of the external path tag to complete the insertion.
Further, the link external resource tag is generally shown in an english form in the web page standard language file, and traverses keywords such as script and the like, and the path tag is also generally shown in an english form in the web page standard language file, and traverses keywords such as src and the like. The insertion process is for example as follows:
and S2, receiving request information of a user in the browser, and judging whether the request information is common request information or storage request information.
Preferably, the request of the user in the browser is divided into: common requests and storage requests. The common request comprises a series of non-storage operations such as setting the browser skin, the default pop-up frame size of the browser, adjusting the font size of the current webpage, refreshing the current webpage and the like when the current webpage is accessed, and the non-storage is that a user does not need to access and download an original picture, an original audio, an original form and the like through the browser. The access operation is the operation of accessing or downloading an original picture, an original audio, an original form and the like by a user in the browser. The most essential difference between the common request and the storage request is that the common request only accesses a webpage, the webpage comprises information such as pictures and tables, the information is fixedly placed in the webpage based on the webpage standard language file, and the storage request directly accesses website information such as pictures and tables and reads the pictures and tables in a non-webpage form.
And S3, if the request information is the common request information, directly calling the web page standard language file to execute the request information.
Preferably, the calling the web page standard language file to execute the request information includes: judging the execution type of the common request information, operating the corresponding execution code in the webpage standard language file according to the execution type, and obtaining the execution result of the common request information and returning the execution result to the user after the execution code is operated.
Preferably, the execution categories include: accessing a web site, returning to a previous page, entering a next page, closing a current tab page, closing a browser, setting the size of the browser (inputting parameters into the length and width of the browser), maximizing the browser, refreshing the page, and the like.
Preferably, the executable code may be written in a programming language such as C + +, JAVA, or the like, and the executable code functions corresponding to the execution categories are as follows: get (url), back (), forward (), close (), driver.quit (), set _ window _ size (x, y), maximize _ window (), refresh (), etc.
And S4, if the request information is the storage request information, judging whether the request result of the storage request information exists locally.
Preferably, the request result is a result obtained after the user accesses the non-web page information, and if the user accesses and downloads the registration form of the user, the registration form of the user is the request result, and whether the registration form of the user exists locally is judged. Because other users have downloaded locally or the users forget after downloading, and the like, if the request result exists locally, resources can be saved by directly calling.
And S5, if the request result of the storage request information exists locally, directly returning the request result to the user.
And S6, if the request result of the storage request information does not exist locally, downloading the request result based on the pre-constructed script code and the website of the storage request information and returning the request result to the user.
Preferably, downloading the request result based on the pre-constructed script code and returning the request result to the user includes: and extracting the URL link of the storage request information, placing the URL link in the pre-constructed script code, operating the pre-constructed script code to access the URL link to obtain the request result, storing the request result locally and returning the request result to the user.
Further, running the pre-built script code to access the URL link to obtain the request result includes: the webpage standard language file creates a document object model, a linked external resource label and a path label are created in the document object model based on a dynamic script technology, meanwhile, a script code containing the URL link is copied to the document object model, and the document object model is operated to obtain the request result.
The document object model is based on a DOM structure, because the browser can easily generate blockage in the analysis and execution processes when the pre-constructed script code is directly operated, in brief, when the pre-constructed script code is operated, the analysis, the rendering and the resource downloading of other pages can be suspended until the pre-constructed script code is completely executed. Therefore, it is preferable that a document object model is constructed in advance, so that the script code runs in the document object model, and the running of other script files such as parsing, rendering, resource downloading and the like is not influenced.
Further, when the user subsequently continues the request operation, if the step S6 has stored the request result to the local, the user may directly access the local.
The invention also provides a browser cache management device. Fig. 2 is a schematic diagram illustrating an internal structure of a browser cache management apparatus according to an embodiment of the present invention.
In this embodiment, the browser cache management device 1 may be a PC (Personal Computer), a terminal device such as a smart phone, a tablet Computer, or a mobile Computer, or may be a server. The browser cache management device 1 includes at least a memory 11, a processor 12, a communication bus 13, and a network interface 14.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may be an internal storage unit of the browser cache management apparatus 1 in some embodiments, for example, a hard disk of the browser cache management apparatus 1. The memory 11 may also be an external storage device of the browser cache management apparatus 1 in other embodiments, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the browser cache management apparatus 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the browser cache management apparatus 1. The memory 11 may be used not only to store application software installed in the browser cache management apparatus 1 and various types of data, such as codes of the browser cache management program 01, but also to temporarily store data that has been output or is to be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip, and is used for executing program codes stored in the memory 11 or Processing data, such as executing the browser cache management program 01.
The communication bus 13 is used to realize connection communication between these components.
The network interface 14 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), typically used to establish a communication link between the apparatus 1 and other electronic devices.
Optionally, the apparatus 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or a display unit as appropriate, is used for displaying information processed in the browser cache management apparatus 1 and for displaying a visualized user interface.
Fig. 2 shows only the browser cache management apparatus 1 with the components 11-14 and the browser cache management program 01, and it will be understood by those skilled in the art that the structure shown in fig. 1 does not constitute a limitation of the browser cache management apparatus 1, and may include fewer or more components than those shown, or combine some components, or a different arrangement of components.
In the embodiment of the apparatus 1 shown in fig. 2, the memory 11 stores a browser cache management program 01; the processor 12 implements the following steps when executing the browser cache management program 01 stored in the memory 11:
step one, inserting a pre-constructed script code into a webpage standard language file.
Preferably, the pre-constructed script code is written based on a programming language such as Javascript. The script code is inserted into the web page standard language file to perform relevant operations according to the specific actions performed by the user, such as: the user clicks a picture A when accessing the web page, soThe script code will detect the user's click action and then access the URL link of picture a (the URL link is also called uniform resource locator, which is a compact representation of the location and access method of the resources available from the internet), and request the original picture a of picture a from a remote server1(typically, the original picture is more sharp relative to the picture on the page), and the original picture A is taken1And downloading to a local browser for viewing. The series of operations, called static file cache, which stores the file requested by the user on the local computer, is all performed by the pre-built script code. The files include pictures, links, even music, programs, etc.
Preferably, the web page standard language file is a necessary web page browsing file based on hypertext markup language (such as HTML and CSS), is a basis for a browser to access a web page, can provide functions such as a web page display position, a web page scaling, formatting, refreshing and the like, and can operate elements of the web page, such as a web page font size, web page picture browsing and the like.
Preferably, the inserting comprises: traversing all the link external resource tags in the web page standard language file to obtain a link external resource tag set, traversing the link external resource tags with path tags from the link external resource tag set to obtain an external path tag set, traversing each external path tag of the external path tag set, and sequentially inserting the pre-constructed script code into the path tag position of the external path tag to complete the insertion.
Further, the link external resource tag is generally shown in an english form in the web page standard language file, and traverses keywords such as script and the like, and the path tag is also generally shown in an english form in the web page standard language file, and traverses keywords such as src and the like. The insertion process is for example as follows:
and step two, receiving request information of a user in the browser, and judging whether the request information is common request information or storage request information.
Preferably, the request of the user in the browser is divided into: common requests and storage requests. The common request comprises a series of non-storage operations such as setting the browser skin, the default pop-up frame size of the browser, adjusting the font size of the current webpage, refreshing the current webpage and the like when the current webpage is accessed, and the non-storage is that a user does not need to access and download an original picture, an original audio, an original form and the like through the browser. The access operation is the operation of accessing or downloading an original picture, an original audio, an original form and the like by a user in the browser. The most essential difference between the common request and the storage request is that the common request only accesses a webpage, the webpage comprises information such as pictures and tables, the information is fixedly placed in the webpage based on the webpage standard language file, and the storage request directly accesses website information such as pictures and tables and reads the pictures and tables in a non-webpage form.
And step three, if the request information is the common request information, directly calling the webpage standard language file to execute the request information.
Preferably, the calling the web page standard language file to execute the request information includes: judging the execution type of the common request information, operating the corresponding execution code in the webpage standard language file according to the execution type, and obtaining the execution result of the common request information and returning the execution result to the user after the execution code is operated.
Preferably, the execution categories include: accessing a web site, returning to a previous page, entering a next page, closing a current tab page, closing a browser, setting the size of the browser (inputting parameters into the length and width of the browser), maximizing the browser, refreshing the page, and the like.
Preferably, the executable code may be written in a programming language such as C + +, JAVA, or the like, and the executable code functions corresponding to the execution categories are as follows: get (url), back (), forward (), close (), driver.quit (), set _ window _ size (x, y), maximize _ window (), refresh (), etc.
And step four, if the request information is the storage request information, judging whether a request result of the storage request information exists locally.
Preferably, the request result is a result obtained after the user accesses the non-web page information, and if the user accesses and downloads the registration form of the user, the registration form of the user is the request result, and whether the registration form of the user exists locally is judged. Because other users have downloaded locally or the users forget after downloading, and the like, if the request result exists locally, resources can be saved by directly calling.
And step five, if the request result of the storage request information exists locally, directly returning the request result to the user.
And step six, if the request result of the storage request information does not exist locally, downloading the request result based on the pre-constructed script code and the website of the storage request information and returning the request result to the user.
Preferably, downloading the request result based on the pre-constructed script code and returning the request result to the user includes: and extracting the URL link of the storage request information, placing the URL link in the pre-constructed script code, operating the pre-constructed script code to access the URL link to obtain the request result, storing the request result locally and returning the request result to the user.
Further, running the pre-built script code to access the URL link to obtain the request result includes: the webpage standard language file creates a document object model, a linked external resource label and a path label are created in the document object model based on a dynamic script technology, meanwhile, a script code containing the URL link is copied to the document object model, and the document object model is operated to obtain the request result.
The document object model is based on a DOM structure, because the browser can easily generate blockage in the analysis and execution processes when the pre-constructed script code is directly operated, in brief, when the pre-constructed script code is operated, the analysis, the rendering and the resource downloading of other pages can be suspended until the pre-constructed script code is completely executed. Therefore, it is preferable that a document object model is constructed in advance, so that the script code runs in the document object model, and the running of other script files such as parsing, rendering, resource downloading and the like is not influenced.
Further, when the user subsequently continues the request operation, if the step S6 has stored the request result to the local, the user may directly access the local.
Alternatively, in other embodiments, the browser cache management program may be further divided into one or more modules, and the one or more modules are stored in the memory 11 and executed by one or more processors (in this embodiment, the processor 12) to implement the present invention.
For example, referring to fig. 3, a schematic diagram of program modules of a browser cache management program in an embodiment of the browser cache management apparatus of the present invention is shown, in this embodiment, the browser cache management program may be divided into a script code insertion module 10, a request information determination module 20, a local determination module 30, and a request result output module 40, which exemplarily:
the script code insertion module 10 is configured to: and inserting the pre-constructed script code into a webpage standard language file in the browser.
The request information determining module 20 is configured to: receiving request information of a user in the browser, judging whether the request information is common request information or storage request information, directly calling the webpage standard language file to execute the request information when the request information is the common request information, and judging local information when the request information is the storage request information.
The model training module 30 is configured to: and if the request result of the storage request information exists locally, directly returning the request result to the user.
The request result output module 40 is configured to: and if the request result of the storage request information does not exist locally, downloading the request result based on the pre-constructed script code and the website of the storage request information and returning the request result to the user.
The functions or operation steps implemented when the program modules such as the script code inserting module 10, the request information determining module 20, the local determining module 30, and the request result outputting module 40 are executed are substantially the same as those of the above embodiments, and are not described herein again.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a browser cache management program is stored on the computer-readable storage medium, where the browser cache management program is executable by one or more processors to implement the following operations:
and inserting the pre-constructed script code into a webpage standard language file in the browser.
Receiving request information of a user in the browser, judging whether the request information is common request information or storage request information, directly calling the webpage standard language file to execute the request information when the request information is the common request information, and judging local information when the request information is the storage request information.
And if the request result of the storage request information exists locally, directly returning the request result to the user.
And if the request result of the storage request information does not exist locally, downloading the request result based on the pre-constructed script code and the website of the storage request information and returning the request result to the user.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (10)
1. A browser cache management method, characterized in that the method comprises:
inserting a pre-constructed script code into a webpage standard language file in a browser;
receiving request information of a user in the browser, and judging whether the request information is common request information or storage request information;
when the request information is the common request information, directly calling the webpage standard language file to execute the request information;
when the request information is the storage request information, judging whether a request result of the storage request information exists locally;
if the request result of the storage request information exists locally, the request result is directly returned to the user;
and if the request result of the storage request information does not exist locally, downloading the request result based on the pre-constructed script code and the website of the storage request information and returning the request result to the user.
2. The browser cache management method according to claim 1, wherein the inserting of the pre-built script code into the web page standard language file in the browser comprises:
traversing to obtain all external resource tags of the links in the web page standard language file to obtain a tag set of the external resource tags of the links;
traversing the link external resource label set to obtain a link external resource label with a path label, and obtaining an external path label set;
traversing each external path label in the external path label set, and sequentially importing the pre-constructed script code into the path label position of the external path label to complete insertion.
3. The browser cache management method according to claim 1 or 2, wherein when the request information is the common request information, directly invoking the web page standard language file to execute the request information includes:
judging the execution type of the common request information;
and running the corresponding execution code in the webpage standard language file according to the execution type, and returning the execution result of the common request information obtained by running the execution code to the user.
4. The browser cache management method according to claim 1, wherein the downloading and returning the request result to the user based on the pre-constructed script code and the website address storing the request information comprises:
extracting a URL link of the storage request information;
placing the URL link in the pre-constructed script code, and operating the pre-constructed script code to access the URL link to obtain the request result;
and storing the request result locally and returning the request result to the user.
5. The browser cache management method according to claim 4, wherein the executing the pre-built script code to access the URL link to obtain the request result comprises:
creating a document object model by using the webpage standard language file;
establishing a link external resource tag and a path tag in the document object model based on a dynamic script technology;
and storing the script code containing the URL link into a link external resource label and a path label of the document object model, and operating the document object model to obtain the request result.
6. A browser cache management apparatus, comprising a memory and a processor, wherein the memory stores a browser cache management program operable on the processor, and the browser cache management program when executed by the processor implements the steps of:
inserting a pre-constructed script code into a webpage standard language file in a browser;
receiving request information of a user in the browser, and judging whether the request information is common request information or storage request information;
when the request information is the common request information, directly calling the webpage standard language file to execute the request information;
when the request information is the storage request information, judging whether a request result of the storage request information exists locally;
if the request result of the storage request information exists locally, the request result is directly returned to the user;
and if the request result of the storage request information does not exist locally, downloading the request result based on the pre-constructed script code and the website of the storage request information and returning the request result to the user.
7. The browser cache management device of claim 6, wherein the inserting of the pre-built script code into the web page standard language file in the browser comprises:
traversing to obtain all external resource tags of the links in the web page standard language file to obtain a tag set of the external resource tags of the links;
traversing the link external resource label set to obtain a link external resource label with a path label, and obtaining an external path label set;
traversing each external path label in the external path label set, and sequentially importing the pre-constructed script code into the path label position of the external path label to complete insertion.
8. The apparatus for managing browser cache according to claim 6 or 7, wherein the directly invoking the web page standard language file to execute the request information when the request information is the frequently-used request information comprises:
judging the execution type of the common request information;
and running the corresponding execution code in the webpage standard language file according to the execution type, and returning the execution result of the common request information obtained by running the execution code to the user.
9. The browser cache management device according to claim 8, wherein the downloading and returning to the user of the request result based on the pre-built script code and the web address storing the request information comprises:
extracting a URL link of the storage request information;
placing the URL link in the pre-constructed script code, and operating the pre-constructed script code to access the URL link to obtain the request result;
and storing the request result locally and returning the request result to the user.
10. A computer-readable storage medium having a browser cache management program stored thereon, the browser cache management program being executable by one or more processors to perform the steps of the browser cache management method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910868056.1A CN110727891A (en) | 2019-09-09 | 2019-09-09 | Browser cache management method and device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910868056.1A CN110727891A (en) | 2019-09-09 | 2019-09-09 | Browser cache management method and device and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110727891A true CN110727891A (en) | 2020-01-24 |
Family
ID=69218150
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910868056.1A Pending CN110727891A (en) | 2019-09-09 | 2019-09-09 | Browser cache management method and device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110727891A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103440276A (en) * | 2013-08-08 | 2013-12-11 | 星云融创(北京)信息技术有限公司 | Method and device for improving webpage display speed |
WO2015196954A1 (en) * | 2014-06-24 | 2015-12-30 | 北京奇虎科技有限公司 | Webpage element display method and browser device |
CN105701153A (en) * | 2015-12-29 | 2016-06-22 | 北京金山安全软件有限公司 | Method and device for reading webpage resources and electronic equipment |
CN105868354A (en) * | 2016-03-29 | 2016-08-17 | 北京小米移动软件有限公司 | Web page repairing method and device |
CN105893598A (en) * | 2016-04-20 | 2016-08-24 | 上海斐讯数据通信技术有限公司 | Method and device for downloading pictures from mobile terminal |
CN107040584A (en) * | 2017-02-22 | 2017-08-11 | 阿里巴巴集团控股有限公司 | The method and device of client downloads picture |
-
2019
- 2019-09-09 CN CN201910868056.1A patent/CN110727891A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103440276A (en) * | 2013-08-08 | 2013-12-11 | 星云融创(北京)信息技术有限公司 | Method and device for improving webpage display speed |
WO2015196954A1 (en) * | 2014-06-24 | 2015-12-30 | 北京奇虎科技有限公司 | Webpage element display method and browser device |
CN105701153A (en) * | 2015-12-29 | 2016-06-22 | 北京金山安全软件有限公司 | Method and device for reading webpage resources and electronic equipment |
CN105868354A (en) * | 2016-03-29 | 2016-08-17 | 北京小米移动软件有限公司 | Web page repairing method and device |
CN105893598A (en) * | 2016-04-20 | 2016-08-24 | 上海斐讯数据通信技术有限公司 | Method and device for downloading pictures from mobile terminal |
CN107040584A (en) * | 2017-02-22 | 2017-08-11 | 阿里巴巴集团控股有限公司 | The method and device of client downloads picture |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8990289B2 (en) | Server based framework for improving Ajax performance | |
US10185704B2 (en) | Webpage browsing method, webapp framework, method and device for executing javascript and mobile terminal | |
US7853593B2 (en) | Content markup transformation | |
CN102663126B (en) | Method and device for displaying webpage in mobile terminal | |
US8977653B1 (en) | Modifying web pages to reduce retrieval latency | |
US8762556B2 (en) | Displaying content on a mobile device | |
US7865544B2 (en) | Method and system for providing XML-based asynchronous and interactive feeds for web applications | |
US9826052B2 (en) | Web page content loading control method and device | |
CN106294658B (en) | Webpage quick display method and device | |
US8527862B2 (en) | Methods for making ajax web applications bookmarkable and crawlable and devices thereof | |
US8245125B1 (en) | Hybrid rendering for webpages | |
US20120066379A1 (en) | Method and system for notifying network resource updates | |
CN110209966B (en) | Webpage refreshing method, webpage system and electronic equipment | |
WO2013178094A1 (en) | Page display method and device | |
US11677809B2 (en) | Methods for transforming a server side template into a client side template and devices thereof | |
CN110647699A (en) | Web page rendering method, apparatus, computer equipment and storage medium | |
US20110145299A1 (en) | Offline Gadgets IDE | |
CN104217037A (en) | Method and device for displaying web page in mobile terminal | |
CN108595697B (en) | Webpage integration method, device and system | |
CN102663050B (en) | Method and device for processing electronic book data | |
CN102298599A (en) | Offline Webpage Browsing Method and System | |
US20170032494A1 (en) | Methods for displaying a webpage fragment on a desktop and systems for taking a snapshot of webpage fragment for displaying on a desktop | |
US8812551B2 (en) | Client-side manipulation of tables | |
CN110020304A (en) | A kind of method and apparatus of loading page | |
CN112637361B (en) | Page proxy method, device, electronic equipment and storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200124 |