CN109522501B - Page content management method and device - Google Patents

Page content management method and device Download PDF

Info

Publication number
CN109522501B
CN109522501B CN201811418446.0A CN201811418446A CN109522501B CN 109522501 B CN109522501 B CN 109522501B CN 201811418446 A CN201811418446 A CN 201811418446A CN 109522501 B CN109522501 B CN 109522501B
Authority
CN
China
Prior art keywords
cached
page content
page
storage area
storage
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.)
Active
Application number
CN201811418446.0A
Other languages
Chinese (zh)
Other versions
CN109522501A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201811418446.0A priority Critical patent/CN109522501B/en
Publication of CN109522501A publication Critical patent/CN109522501A/en
Application granted granted Critical
Publication of CN109522501B publication Critical patent/CN109522501B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides a page content management method and a device thereof, wherein the method comprises the following steps: acquiring the content of a page to be cached of an access request page; determining a first page content to be cached and a second page content to be cached except the first page content to be cached from the page content to be cached according to a preset storage list; and storing the first page content to be cached in a first storage area, and storing the second page content to be cached in a second storage area. By adopting the embodiment of the invention, not only can cookie abuse be avoided, but also storage is prevented from being over saturated, thereby being beneficial to improving page performance, reducing the loss of user bandwidth and reducing the probability of page abnormity.

Description

Page content management method and device
Technical Field
The invention relates to the technical field of Internet, in particular to a page content management method and a page content management device.
Background
At present, for the page content of the web page (web) front end, such as login information, interface token (token), first page information of the page, information between pages, and other information, two storage modes, namely cookie and storage, are generally adopted to cache the page content of the web front end.
The cookie refers to data stored on the user's local terminal by the website for identifying the user's identity and performing session (session) tracking. The cookie is a technology for the server to store a small amount of data in the hard disk or the memory of the local terminal and read the data from the hard disk or the memory of the local terminal. cookie, the size supported by the browser is limited (4 or 8 kilobytes). The cookie is valid for the life cycle and is cleared beyond the life cycle. storage is used for storing page contents locally, the size supported by a general browser is 5M, and the problem of insufficient cookie storage space is solved. The storage comprises a session storage and a local storage, wherein the session storage is used for storing data of one session, the stored data is effective in the session, and the stored data can be cleared after a page or a browser is closed; a local store is a data store without time constraints, and stored data is always valid and will be permanently saved unless manually cleared. In other words, storage has no life cycle.
Because the content of the web front end needing to be cached is more, and no management and limitation are performed on caching by adopting cookies and adopting storage, namely, no correlation exists between the two storage modes, some page contents should be cached by adopting storage, but are cached by adopting cookies, and therefore cookie abuse is caused. The cookie is generally transmitted along with a background interface request, and the misuse of the cookie wastes user bandwidth, so that the interface return speed is slow, and the page performance is poor. There is no life cycle for the storage, and it may appear that the storage is too saturated even if the size of the storage is larger than the cookie. Whether cookie or storage, a page exception may result once the size of the stored data exceeds the upper limit supported by the browser.
Disclosure of Invention
The page content management method and the device thereof can avoid cookie abuse and prevent storage from being too saturated, thereby being beneficial to improving page performance, reducing the loss of user bandwidth and reducing the probability of page abnormity.
A first aspect of an embodiment of the present invention provides a page content management method, including:
acquiring the content of a page to be cached of an access request page;
determining a first page content to be cached and a second page content to be cached except the first page content to be cached from the page content to be cached according to a preset storage list;
and storing the first page content to be cached in a first storage area, and storing the second page content to be cached in a second storage area.
Optionally, before obtaining the content of the page to be cached of the access request page, the method further includes:
and acquiring first cached page content of the access request page from the first storage area, and acquiring second cached page content of the access request page from the second storage area.
Optionally, the obtaining the second cached page content of the access request page from the second storage area includes:
and acquiring a second cached page content corresponding to a preset key value from the second storage area according to the preset key value, wherein the preset key value comprises a public key value and a specified key value.
Optionally, the method further includes:
and acquiring third cached page content which does not belong to the first storage list from the first storage area, and deleting the third cached page content.
Optionally, the method further includes:
and acquiring fourth cached page content with a caching time exceeding a preset threshold from the second storage area, and deleting the fourth cached page content.
Optionally, the method further includes:
if the content of the target cache page needs to be sent to a server together with an access request corresponding to the access request page, adding the content of the target cache page to the preset storage list, and updating the preset storage list;
and the target cache page content is contained in the page content to be cached or the cached page content.
Optionally, the first storage area is a storage area corresponding to a cookie, the second storage area is a storage area corresponding to a storage, and the preset storage list is a preset cookie storage list.
A second aspect of the embodiments of the present invention provides a page content management apparatus, including a processing unit and a storage unit;
the processing unit is used for acquiring the content of the page to be cached of the access request page;
the processing unit is further used for determining a first page content to be cached and a second page content to be cached except the first page content to be cached from the page content to be cached according to a preset storage list;
the storage unit is used for storing the first page content to be cached in a first storage area and storing the second page content to be cached in a second storage area.
Optionally, the processing unit is further configured to obtain a first cached page content of the access request page from the first storage area; and acquiring second cached page content of the access request page from the second storage area.
Optionally, the processing unit is configured to obtain a second cached page content of the access request page from the second storage area, and specifically, to obtain the second cached page content corresponding to a preset key value from the second storage area according to the preset key value, where the preset key value includes a public key value and a specified key value.
Optionally, the processing unit is further configured to obtain, from the first storage area, third cached page content that does not belong to the first storage list, and delete the third cached page content.
Optionally, the processing unit is further configured to obtain a fourth cached page content with a caching time exceeding a preset threshold from the second storage area, and delete the fourth cached page content.
Optionally, the processing unit is further configured to add the content of the target cache page to the preset storage list and update the preset storage list if the content of the target cache page needs to be sent to the server together with the access request corresponding to the access request page;
and the target cache page content is contained in the page content to be cached or the cached page content.
Optionally, the first storage area is a storage area corresponding to a cookie, the second storage area is a storage area corresponding to a storage, and the preset storage list is a preset cookie storage list.
A third aspect of embodiments of the present invention provides a page content management apparatus, where the page content management apparatus includes a processor, an input module, an output module, a communication interface, and a memory, where the memory stores a computer program, and the computer program includes program instructions, and the processor is configured to call the program code to execute the method according to the first aspect.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium, in which a computer program is stored, the computer program comprising program instructions that, when executed by a page content management apparatus, cause the page content management apparatus to perform the method of the first aspect.
By adopting the embodiment of the invention, the page content to be cached is distinguished according to the preset storage list to obtain the first page content to be cached and the second page content to be cached, the first page content to be cached is stored in the first storage area, and the second page content to be cached is stored in the second storage area, so that the abuse of cookies can be avoided, and the excessive saturation of storage can be avoided, thereby being beneficial to improving the page performance, reducing the loss of user bandwidth and reducing the probability of page abnormity.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic diagram of a network architecture to which embodiments of the present invention are applied;
fig. 2 is a schematic flowchart of a page content management method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating an example scenario in which an embodiment of the present invention is applied;
fig. 4 is a schematic flowchart of another page content management method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a logical structure of page content management according to an embodiment of the present invention;
fig. 6 is a schematic entity structure diagram of page content management according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic diagram of a network architecture to which the embodiments of the present invention are applied. The network architecture diagram includes a server 101, a user terminal 102 and a user 103. It should be noted that the number and the form of each device in the network architecture diagram shown in fig. 1 are for example and do not constitute a limitation to the embodiment of the present invention.
The user terminal 102 may be a Personal Computer (PC), a notebook computer, or a smart phone shown in fig. 1, or may be an electronic device such as an all-in-one machine, a palm computer, a tablet computer (pad), a smart television playing terminal, a vehicle-mounted terminal, or a portable device. The PC end user terminal, such as a kiosk, etc., may have an operating system including, but not limited to, Linux system, Unix system, Windows series system (e.g., Windows xp, Windows 7, etc.), Mac OS X system (operating system of apple computer), etc. The operating system of the mobile end user terminal, such as a smart phone, may include, but is not limited to, an operating system such as an android system, an IOS (operating system of an apple mobile phone), a Window system, and the like.
The user terminal 102 in the embodiment of the present invention may install and run an application program, and may support and implement a function of a browser. The user terminal may interact with the server 101 when implementing the function of the browser, for example, transmit a request for acquiring a web resource to the server 101, receive a web resource transmitted from the server 101, and the like.
The server 101 may be a server corresponding to an application installed in the user terminal 102 and providing an application service for the application, or may be a server corresponding to a browser on the user terminal and providing a web service, a security authentication service, an identity authentication service, and the like for the browser.
The user 103 may be a user who actually operates the user terminal or a developer. The user 103 may input an operation instruction to the user terminal to control the user terminal 102 to perform a corresponding operation.
In view of the disadvantages of the current page content caching, embodiments of the present invention provide a page content management method and apparatus, which can avoid cookie abuse and prevent storage from being too saturated, thereby facilitating improvement of page performance, reduction of user bandwidth loss, and reduction of page anomaly probability.
The page content management method of the embodiment of the invention can be applied to products developed by the web front end, and the products developed by the web front end can include but are not limited to H5 pages of a penguin medical dictionary, H5 pages embedded by an application program, H5 pages of webpage views (web views) of applets and the like which are presented by using a browser kernel. H5 is the fifth major modification of the core Language of the world wide web, an application hypertext Markup Language (HTML) under the standard universal Markup Language. H5 provides a completely new framework and platform for the next generation of internet, such as plug-in free audio-video, image animation, local storage, and more sophisticated and important functions, and standardizes and opens these applications, thus enabling the internet to easily implement desktop-like application experiences.
The page content management device of the embodiment of the invention can be application programs on the user terminal, and the application programs can be embedded into an H5 page or a browser on the user terminal.
Before describing the page content management method provided by the embodiment of the present invention, the names or technical terms related to the embodiment of the present invention are described.
cookie: the method is a technology that a server stores a small amount of data into a hard disk or a memory of a local terminal and reads the data from the hard disk or the memory of the local terminal. The client sends a request message to the server for the first time, wherein the request message is used for requesting to access the server; after receiving the request message and performing identity authentication, the server extracts corresponding resources and sends a response message to the client, wherein the response message carries the resources; after receiving the response message, the client stores the resource locally, wherein the resource comprises expiration time (Expires); when the client sends the request message to the server for the second time, the client searches the resource in the cache first, acquires the failure time of the resource, compares the failure time with the current request time, acquires the resource from the cache if the current request time is before the failure time, and otherwise requests the server again to acquire the resource again. Wherein the failure time may also be referred to as a life cycle.
The storage includes session storage and local storage. A session storage maintains storage space that is available during a page session. The page session period will last as long as the browser is on. Page sessions also always exist when pages are reloaded (reloaded) or restored (restore). Each time a new page is opened in a new tab or window, a new session is initiated. A local storage maintains various public or private memory spaces that can be used to store data for long periods of time (e.g., between multiple pages and browser sessions).
The storage of storage is composed of a key name (key) and a key value (value), and data can be stored, read or cleared by calling a corresponding function. For example, storage, setitem ('key', 'value') is used for storing data, and mainly receives two parameters of key and value; getItem ('key') is used for reading data, receiving a parameter of the key, and reading a value corresponding to the key; removeitem ('key') is used to clear the value to which the key corresponds. In the embodiment of the present invention, the key is used to indicate that the value corresponding to the key is synchronously acquired from the local cache.
The preset storage list refers to a preset cookie storage list used for determining which page contents should be stored by using cookies, that is, page contents included in the preset cookie list should be stored by using cookies. It is understood that the preset cookie storage list is a cookie white list. The cookie white list can be edited by a developer in the process of developing the web front-end product, the content included in the cookie white list is not fixed and unchangeable, and the developer can add or delete the cookie white list according to the actual situation.
The first storage area refers to a storage area corresponding to the cookie, that is, the storage area is used for storing data stored in a cache manner such as cookie.
The second storage area refers to a storage area corresponding to the storage, that is, is used for storing data stored in a cache manner such as storage.
The page content to be cached refers to the page content needing to be cached. The cached page content refers to page content that has been cached locally at the user terminal, and may include page content that has been cached in the first storage area and page content that has been cached in the second storage area. The page content may also be referred to as page data or data.
Referring to fig. 2, a schematic flow chart of a page content management method according to an embodiment of the present invention is shown, where the method includes, but is not limited to, the following steps:
step S201, obtaining the content of the page to be cached of the access request page.
The page content management device obtains the content of the page to be cached of the access request page, specifically, the content of the page to be cached of the access request H5 page may be obtained. The access request page is a page requested to be accessed by the access request.
In one possible implementation, the user inputs an H5 page jump instruction for the first time to an application on the user terminal, and the H5 page jump instruction is used to trigger a jump from the display interface of the application to an H5 page to be accessed by the user. It is understood that the H5 page jump instruction is an access request. When receiving an access request, the page content management device sends a request message to a corresponding server, where the request message is used to request the server for page content corresponding to the access request, so as to output a page corresponding to the access request, that is, an access request page. The server, upon receiving the request message, may send a response message to the page content management apparatus after performing the identity authentication, the response message may carry the requested page content. The page content management device may cache some or all of the page content when receiving the page content from the server, so as to extract the corresponding page content from the local cache region next time when receiving the access request.
It is understood that in this implementation manner, the page content management apparatus obtains the page content to be cached of the access request page from the server. When receiving the page content from the server, the page content management device can screen the page content to determine which page contents need to be cached and which page contents do not need to be cached, and the page content needing to be cached is the page content to be cached.
In one possible implementation, the user inputs an H5 page jump instruction to an application on the user terminal N times (N is an integer greater than 1). It is understood that the H5 page jump instruction is an access request. When receiving the access request, the page content management device searches and acquires cached page content of the access request page from the local cache region, and sends a request message to the server for page content which does not exist in the local cache region, so as to acquire the remaining page content of the access request page. After receiving the request message and performing identity authentication, the server may send a response message to the page content management apparatus according to the request message, where the response message carries the requested remaining page content. The page content management device can cache part or all of the remaining page content when receiving the remaining page content from the server, so as to extract the corresponding page content from the local cache region next time when receiving the page access request.
It can be understood that, in this implementation manner, for the page content that cannot be obtained from the local cache region, the page content management device obtains the page content from the server, and when receiving the page content from the server, may screen the page content to determine which page contents need to be cached and which page contents do not need to be cached, and the page content that needs to be cached is the page content to be cached.
The local cache area can be divided into a first storage area and a second storage area, the first storage area is a storage area corresponding to the cookie, and the second storage area is a storage area corresponding to the storage. At present, the data stored in the first storage area has a failure time, while the data stored in the second storage area has no failure time. The page content that cannot be obtained from the local cache region may be page content that has never been cached in the local cache region, or page content that has been cached and cleaned after the expiration time.
The web front-end product developer can set a cache rule in the development process, namely, which page contents can be cached, which page contents do not need to be cached, so that the page content management device can screen according to the cache rule when receiving the page contents from the server, and determine which page contents need to be cached and which page contents do not need to be cached. Developers of web front-end products may set different caching rules for different web front-ends.
Step S202, determining a first page content to be cached and a second page content to be cached except the first page content to be cached from the page content to be cached according to a preset storage list.
The page content management device determines a first page content to be cached and a second page content to be cached except the first page content to be cached from the page content to be cached according to a preset storage list. Specifically, the first page content to be cached corresponding to the cookie white list is determined from the page content to be cached, and the cookie white list is used for indicating which page contents are cached to the storage area corresponding to the cookie, so that the first page content to be cached to the storage area corresponding to the cookie is determined according to the cookie white list.
The cookie white list can be edited by a developer in the process of developing the web front-end product, the content included in the cookie white list is not fixed and unchangeable, and the developer can add or delete the cookie white list according to the actual situation. The content included in the cookie white lists of different web front end products may be different, and the specifically included content is set by a developer.
The cookie white list may include, but is not limited to, user login information, reporting information, network environment information, interface token information, Cross-site request forgery (CSRF) information, and the like. The user login information may include information such as a user account, a password, a nickname, a user status (online, offline, busy, etc.), a user level, and the like. The report information may include information that the client needs to report to the server, and the client may be an application program or a browser on the user terminal. The network environment information refers to the type of network connected to the user terminal, such as a Wireless Fidelity (WiFi) network, a fourth generation mobile communication (4)thGeneration, 4G) networks, etc. The interface token information, i.e. the interface token information or the interface identification information, is used to authenticate the interface in the computer identity authentication. The cross-site request forgery information is used to prevent cross-site request forgery to ensure the security of the requested page. The cookie white list does not include the first screen information of the pages, information between the pages, and the like.
Or, the cookie white list may include a cookie cache tag, and the cookie cache tag may be information about user login, report, network environment, and the like.
In a possible implementation manner, the page content management device screens out page content matched with the cookie white list from the page content to be cached, and determines the page content as the first page content to be cached. For example, the page content management apparatus screens out page content matching with the user login information from the page content to be cached, that is, obtains page content related to the user login information from the page content to be cached, and determines the page content as the first page content to be cached.
In a possible implementation manner, when the page content management device obtains the page content a to be cached, the page content management device determines a cookie cache tag of the page content a to be cached, and if the cookie cache tag is a user login, determines the page content a to be cached as the first page content to be cached.
Step S203, store the first page content to be cached in a first storage area, and store the second page content to be cached in a second storage area.
The page content management device stores the first page content to be cached in a first storage area, namely a storage area corresponding to the cookie. Because the space of the storage area corresponding to the cookie is limited, in the embodiment of the present invention, the page content conforming to the cookie white list is stored in the storage area corresponding to the cookie, and the page content not conforming to the cookie white list is stored in the storage area corresponding to the storage.
And the page content management device caches the second page to be cached except the first page to be cached in a second storage area, namely, the page content which does not conform to the cookie white list to the storage area corresponding to the storage.
In the embodiment shown in fig. 2, the page content to be cached is distinguished according to the preset storage list to obtain the first page content to be cached and the second page content to be cached, the first page content to be cached is stored in the first storage area, and the second page content to be cached is stored in the second storage area, so that misuse of cookies can be avoided, and storage too saturation can be avoided, thereby being beneficial to improving page performance, reducing loss of user bandwidth, and reducing the probability of page abnormality.
The embodiment of the invention can be applied to the scene of distinguishing the data stored in the cookie and the storage according to the cookie white list, and can also be applied to the scene of distinguishing any two or more storage modes according to the preset name list.
Fig. 3 is a diagram of an exemplary scenario in which an embodiment of the present invention is applied, where the exemplary scenario takes an example of embedding a WeChat into a page H5. In a friend circle display interface, a user inputs a click instruction aiming at hot news (link) shared by a friend B in a friend circle, which is equivalent to a page access request for the hot news, and when receiving the page access request, a page content management device requests a server for page content corresponding to the hot news so as to output a page of the hot news. The execution process of the embodiment of the invention is equivalent to the process executed by the background of the page content management device in the process of jumping from the left display interface to the right display interface in fig. 3.
Referring to fig. 4, a flow chart of another page content management method according to an embodiment of the present invention is shown, where the method includes, but is not limited to, the following steps:
step S401, receiving an access request corresponding to the access request page.
The page content management device receives an access request input for a client, the access request corresponding to an access request page. Where the client may be an application on the user terminal, the application on the user terminal may be embedded in the H5 page. The client may also be a browser on the user terminal. The access request in the embodiment shown in fig. 4 is an nth access request (N is an integer greater than 1), that is, the local cache area of the user terminal already stores some page contents, so that when the access request is received, some cached page contents required for the access request page can be extracted from the local cache area first.
Step S402, obtaining the first cached page content of the access request page from the first storage area, and obtaining the second cached page content of the access request page from the second storage area.
The page content management device acquires the first cached page content of the access request page from the first storage area, and specifically acquires the first cached page content of the access request page from the storage area corresponding to the cookie.
The page content management device can acquire first cached page content corresponding to the page access request from cached page content included in the first storage area according to a cookie key (key). The cookie key is used for extracting page content matched with the cookie key from cached page content included in a storage area corresponding to the cookie.
The page content management device acquires the second cached page content of the access request page from the second storage area, and specifically acquires the second cached page content corresponding to the access request page from the storage area corresponding to the storage.
The page content management device can acquire second cached page content corresponding to the preset key value from the second storage area according to the preset key value. The preset key value is a storage preset key value and comprises a public key value and a specified key value, the public key value is used for extracting all page contents matched with the public key value from a storage area corresponding to the storage, and the specified key value is used for extracting the page contents matched with the specified key value from the storage area corresponding to the storage. And adding a custom key value (namely a designated key value) in the basis of the public key value to form a new key value so as to facilitate later management and maintenance.
It will be appreciated that the obtaining of the first cached page content and the obtaining of the second cached page content may be performed simultaneously.
In step S403, the access request page is output.
And the page content management device sends a request message to the server when acquiring the first cached page content and the second cached page content from the local cache region, wherein the request message is used for requesting the server to provide the rest page content of the access request. The server, upon receiving the request message, may transmit a response message including the requested remaining page content to the page content management apparatus after performing the identity authentication.
When acquiring all the page contents corresponding to the access request, the page content management apparatus outputs the access request page, for example, outputs a display interface as shown on the right side of fig. 3.
The embodiment shown in fig. 2 may be executed after step S403, or after the remaining page content is acquired before the access request page is output.
Step S404, obtaining third cached page content that does not belong to the preset storage list from the first storage area, and deleting the third cached page content.
The page content management device may obtain, when the access request page is output, third cached page content that does not belong to the first storage list from the first storage area, and delete the third cached page content, specifically, obtain, from the storage area corresponding to the cookie, third cached page content that does not belong to the cookie white list, and delete the third cached page content. In other words, the page content management means clears the cached content of the non-cookie white list when outputting the access request page.
Step S405, obtaining a fourth cached page content whose caching time exceeds a preset threshold from the second storage area, and deleting the fourth cached page content.
In a possible implementation manner, when the page access request is output, the page content management apparatus may obtain, from the second storage area, a fourth cached page content whose caching time exceeds a preset threshold, and delete the fourth cached page content, specifically, obtain, from the storage area corresponding to the storage area, the fourth cached page content whose caching time exceeds the preset threshold, and delete the fourth cached page content. In other words, the page content management apparatus clears the cached page content whose caching time exceeds the preset threshold when outputting the access request page.
The preset threshold is the failure time, and the specific value can be set by a developer. Different expiration times can be set for different storage cache contents.
In the case where the above-described step S404 and step S405 are executed when the access request page is output, these two steps may be executed simultaneously.
In a possible implementation manner, the page content management apparatus may delete the target cached page content if the caching time of the target cached page content exceeds a preset threshold of the target cached page content when the target cached page content is obtained from the second storage area, that is, when the target cached page content is obtained from the cached page content included in the storage area corresponding to the storage area. When the cached page content exceeding the expiration time is deleted, the page content management device returns a null value for indicating that the page content needing to be advanced does not exist, and the page content can be obtained from the server again.
The two modes have different occasions for deleting the cached page content with the caching time exceeding the preset threshold from the second storage area, one mode is deleting when the access request page is output, and the other mode is deleting in the process of acquiring the cached page content.
In the embodiment shown in fig. 4, the cached content in the non-cookie white list is cleaned, and the cache content of the storage whose expiration time is exceeded is cleaned, so that the storage is prevented from being too saturated, thereby facilitating the improvement of page performance, reducing the loss of user bandwidth, and reducing the probability of page abnormality.
As an optional embodiment, if the content of the target cache page needs to be sent to the server together with the access request, the page content management device adds the content of the target cache page to the preset storage list and updates the preset storage list, so that the page content management device can edit and manage the cookie white list, the cookie white list has flexibility, and the intelligence and the flexibility of the page content management device are improved.
The target cache page content may be included in the page content to be cached or may be included in the cached page content.
The page content management device can automatically manage the cookie white list, developers can also manage the cookie white list in the development process of the web front-end product, the developers judge whether certain page content is sent to the server along with the request message, and if necessary, the page content is added into the cookie white list.
The method of embodiments of the present invention is set forth above in detail and the apparatus of embodiments of the present invention is provided below.
Referring to fig. 5, a schematic diagram of a logical structure of a page content management apparatus according to an embodiment of the present invention is provided, where the page content management apparatus 50 includes a processing unit 501 and a storage unit 502.
A processing unit 501, configured to obtain content of a page to be cached in an access request page;
the processing unit 501 is further configured to determine, according to a preset storage list, a first page content to be cached and a second page content to be cached, which is different from the first page content to be cached, from the page contents to be cached;
the storage unit 502 is configured to store the first page content to be cached in a first storage area, and store the second page content to be cached in a second storage area.
Optionally, the processing unit 501 is further configured to obtain first cached page content corresponding to the access request page from the first storage area; second cached page content for the access-requested page is obtained from the second memory region.
Optionally, the processing unit 501 is configured to obtain a second cached page content of the access request page from the second storage area, and specifically, to obtain a second cached page content corresponding to a preset key value from the second storage area according to the preset key value, where the preset key value includes a public key value and a specified key value.
Optionally, the processing unit 501 is further configured to obtain a third cached page content that does not belong to the first storage list from the first storage area, and delete the third cached page content.
Optionally, the processing unit 501 is further configured to obtain a fourth cached page content of which the caching time exceeds a preset threshold from the second storage area, and delete the fourth cached page content.
Optionally, the processing unit 501 is further configured to, if the content of the target cache page needs to be sent to the server together with the access request corresponding to the access request page, add the content of the target cache page to the preset storage list, and update the preset storage list;
the target cache page content is contained in the page content to be cached or the cached page content.
Optionally, the first storage area is a storage area corresponding to a cookie, the second storage area is a storage area corresponding to a storage, and the preset storage list is a preset cookie storage list.
Optionally, the page content management apparatus 50 further includes an input unit 503 and an output unit 504, where the input unit 503 is configured to execute step S401 in the embodiment shown in fig. 4, and the output unit 504 is configured to execute step S403 in the embodiment shown in fig. 4.
The page content management apparatus 50 may implement the functions of the page content management apparatus in the foregoing method embodiments, and for the detailed process executed by each unit in the page content management apparatus 50, reference may be made to the execution steps of the page content management apparatus in the foregoing method embodiments, which are not described herein again.
Referring to fig. 6, which is a schematic physical structure diagram of a page content management apparatus according to an embodiment of the present invention, the page content management apparatus 60 includes a processor 601, an input module 602, an output module 603, a communication interface 604, and a memory 605. The processor 601, the input module 602, the output module 603, the communication interface 604, and the memory 605 may be connected to each other via the bus 606, or may be connected in other manners. The related functions implemented by the processing unit 501 shown in fig. 5 may be implemented by one or more processors 601. The related functions implemented by the storage unit 502 shown in fig. 5 can be implemented by the memory 605. The related functions implemented by the input unit 503 shown in fig. 5 can be implemented by the input module 602. The related functions implemented by the output unit 504 shown in fig. 5 can be implemented by the output module 603.
The processor 601 includes one or more processors, for example, one or more Central Processing Units (CPUs), and in the case that the processor 601 is one CPU, the CPU may be a single-core CPU or a multi-core CPU. In the embodiment of the present invention, the processor 601 is used to control the page content management apparatus to implement the embodiments shown in fig. 2 and fig. 4.
The input module 602 may be an input device such as a keyboard, a mouse, a touch screen, etc., and is used for receiving instructions, data, etc. input by a user. The input module 602 is used for receiving a selection instruction, a click instruction, and the like input by a user in the embodiment of the present invention.
The output module 603 may be an output device such as a screen, a sound, a loudspeaker, etc., and is used for outputting information such as a graphical interface, multimedia data, etc. In the embodiment of the present invention, the output module 603 is used for the page requested by the page access request.
The communication interface 604 is used to enable communication with other devices, such as a server.
The memory 605 includes, but is not limited to, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), and the memory 605 is used for storing relevant instructions and data. In the embodiment of the present invention, the memory 605 is used for storing program codes, instructions, etc. required by the processor 601 to execute, and is also used for caching the contents of the page to be cached.
Embodiments of the present invention also provide a computer-readable storage medium, in which a computer program is stored, where the computer program includes program instructions, and the program instructions, when executed by a page content management apparatus, cause the page content management apparatus to execute the above-mentioned method embodiments.
It should be noted that, for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts or combinations, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The content downloading method, the related device and the system provided by the embodiment of the present invention are described in detail above, and a specific example is applied in the text to explain the principle and the embodiment of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (8)

1. A method for managing page content, comprising:
acquiring a first cached page content of an access request page from a first storage area, and acquiring a second cached page content corresponding to a preset key value from a second storage area according to the preset key value, wherein the preset key value comprises a public key value and a designated key value;
acquiring the content of a page to be cached of an access request page;
determining a first page content to be cached and a second page content to be cached except the first page content to be cached from the page content to be cached according to a preset storage list;
and storing the first page content to be cached in a first storage area, and storing the second page content to be cached in a second storage area.
2. The method of claim 1, further comprising:
and acquiring third cached page content which does not belong to the preset storage list from the first storage area, and deleting the third cached page content.
3. The method of claim 1, further comprising:
and acquiring fourth cached page content with a caching time exceeding a preset threshold from the second storage area, and deleting the fourth cached page content.
4. The method of claim 1, further comprising:
if the content of the target cache page needs to be sent to a server together with an access request corresponding to the access request page, adding the content of the target cache page to the preset storage list, and updating the preset storage list;
and the target cache page content is contained in the page content to be cached or the cached page content.
5. The method according to any one of claims 1 to 4, wherein the first storage area is a storage area corresponding to a cookie, the second storage area is a storage area corresponding to a storage, and the preset storage list is a preset cookie storage list.
6. A page content management apparatus, characterized in that the page content management apparatus comprises a processing unit and a storage unit;
the processing unit is used for acquiring a first cached page content of an access request page from a first storage area, and acquiring a second cached page content corresponding to a preset key value from a second storage area according to the preset key value, wherein the preset key value comprises a public key value and a specified key value;
the processing unit is further configured to obtain content of a page to be cached of the access request page;
the processing unit is further used for determining a first page content to be cached and a second page content to be cached except the first page content to be cached from the page content to be cached according to a preset storage list;
the storage unit is used for storing the first page content to be cached in a first storage area and storing the second page content to be cached in a second storage area.
7. A page content management apparatus, comprising a processor, an input module, an output module, a communication interface and a memory, wherein the memory stores a computer program comprising program instructions, and wherein the processor is configured to invoke the program code to perform the method of any of claims 1 to 5.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a page content management apparatus, cause the page content management apparatus to perform the method of any one of claims 1-5.
CN201811418446.0A 2018-11-26 2018-11-26 Page content management method and device Active CN109522501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811418446.0A CN109522501B (en) 2018-11-26 2018-11-26 Page content management method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811418446.0A CN109522501B (en) 2018-11-26 2018-11-26 Page content management method and device

Publications (2)

Publication Number Publication Date
CN109522501A CN109522501A (en) 2019-03-26
CN109522501B true CN109522501B (en) 2021-10-26

Family

ID=65779247

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811418446.0A Active CN109522501B (en) 2018-11-26 2018-11-26 Page content management method and device

Country Status (1)

Country Link
CN (1) CN109522501B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110297635B (en) * 2019-06-27 2023-05-16 百度在线网络技术(北京)有限公司 Page display method, device, equipment and storage medium
CN111737616B (en) * 2020-06-05 2022-12-20 苏州浪潮智能科技有限公司 Page caching method, device, equipment and medium based on B/S architecture
CN112069436A (en) * 2020-08-11 2020-12-11 长沙市到家悠享网络科技有限公司 Page display method, system and equipment
CN112685663B (en) * 2020-12-21 2023-05-12 福建新大陆软件工程有限公司 SPA multi-tab management method based on VUE

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102368258A (en) * 2011-09-30 2012-03-07 广州市动景计算机科技有限公司 Webpage page caching management method and system
CN103154912A (en) * 2010-08-31 2013-06-12 甲骨文国际公司 Method and system for inserting cache blocks
CN105847365A (en) * 2016-03-28 2016-08-10 乐视控股(北京)有限公司 Content caching method and content caching system
CN108683679A (en) * 2018-05-30 2018-10-19 深圳壹账通智能科技有限公司 More account login methods, device, equipment and the storage medium of Web APP

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6934736B2 (en) * 2001-03-15 2005-08-23 Microsoft Corporation Systems and methods for automatically generating cookies

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103154912A (en) * 2010-08-31 2013-06-12 甲骨文国际公司 Method and system for inserting cache blocks
CN102368258A (en) * 2011-09-30 2012-03-07 广州市动景计算机科技有限公司 Webpage page caching management method and system
CN105847365A (en) * 2016-03-28 2016-08-10 乐视控股(北京)有限公司 Content caching method and content caching system
CN108683679A (en) * 2018-05-30 2018-10-19 深圳壹账通智能科技有限公司 More account login methods, device, equipment and the storage medium of Web APP

Also Published As

Publication number Publication date
CN109522501A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
CN109522501B (en) Page content management method and device
US10430487B2 (en) System and method to share content utilizing universal link format
US9942349B2 (en) Incremental browser-based device fingerprinting
CN110602052A (en) Micro-service processing method and server
US20110093578A1 (en) Data update for website users based on preset conditions
CN110691085B (en) Login method, login device, password management system and computer readable medium
CN112199652B (en) Login method, terminal, server, system, medium and equipment of application program
CN107465693B (en) Request message processing method and device
CN113590974B (en) Recommendation page configuration method and device, electronic equipment and computer readable medium
US20090228549A1 (en) Method of tracking usage of client computer and system for same
CN108959401B (en) Information propagation monitoring and analyzing method, system, server and storage medium
CN113704204A (en) Data file processing method and device, electronic equipment and storage medium
CN106817296B (en) Information recommendation test method and device and electronic equipment
CN105095303B (en) Quick link pushing method and quick link pushing device
CN111046309A (en) Page view rendering method, device and equipment and readable storage medium
CN114398094A (en) Applet starting method, device, equipment and computer readable storage medium
CN110177096B (en) Client authentication method, device, medium and computing equipment
US20220038444A1 (en) Cloud device, application processing method, electronic device and storage medium
CN113918865A (en) Data processing method, data processing apparatus, storage medium, and electronic apparatus
CN115102748B (en) Vulnerability detection method and device, storage medium and electronic equipment
US11829434B2 (en) Method, apparatus and computer program for collecting URL in web page
CN113703819B (en) Dynamic message analysis method, device, equipment and medium
CN115098810A (en) Page data caching method and related equipment thereof
CN110020076B (en) Method and device for crawling webpage data
CN114095245A (en) Tracing method, device, equipment and medium for network attack

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
GR01 Patent grant
GR01 Patent grant