Web application cache management method and device, equipment and storage medium

By using a sorted list of cached components to retrieve and destroy them, the number of cached components can be controlled, thus resolving the lag issue caused by excessive cached components in web applications and improving the user experience.

CN116484128BActive Publication Date: 2026-02-17SHENZHEN BOFEI KETE TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310470872.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-21
Publication Date
2026-02-17
Estimated Expiration
2043-04-21

AI Technical Summary

Technical Problem

Existing web applications experience lag when there are too many currently viewed pages or too many cached components.

Method used

By obtaining the ordered list of cached components, it is determined whether the number of components exceeds the threshold. If it does, the cached components to be destroyed are identified and destroyed, thus controlling the number of cached components.

Benefits of technology

It resolves the lag issue caused by excessive caching components in web applications, improves user experience, and optimizes storage resource usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116484128B_ABST
    Figure CN116484128B_ABST
Patent Text Reader

Abstract

The application discloses a webpage application cache management method and device, equipment and a storage medium, relates to the webpage application cache management technical field, and the method comprises the following steps: acquiring a sequential list of cache components, the sequential list comprising all cache components in a current webpage application; if the number of components in the sequential list exceeds a component number threshold, determining a cache component to be destroyed; and destroying the cache component to be destroyed. When the number of cache components in the webpage application is too large, the cache component to be destroyed is destroyed, the number of cache components in the server is controlled, the storage resources occupied by the cache components are controlled, the storage resources for webpage application operation are ensured, the technical problem that the current browsing page is too large in the existing webpage application, the cache components are too large, and the webpage application is stuck is solved, and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of web application cache management technology, and in particular to a web application cache management method, apparatus, device and storage medium. Background Technology

[0002] In web applications, to provide a better user experience, keep-alive caching components are generally used to cache browsing pages, preventing repeated page loading when users visit the same page multiple times. However, if too many pages are currently being viewed, and too many cached components are present, it can cause the web application to lag or stutter. Summary of the Invention

[0003] The main objective of this invention is to provide a web application cache management method, apparatus, device, and storage medium, which aims to solve the technical problem of web application lag caused by too many currently viewed pages and too many cached components in existing web applications.

[0004] To achieve the above objectives, the present invention adopts the following technical solution:

[0005] In a first aspect, the present invention provides a web application cache management method, applied to a server, the method comprising:

[0006] Get a sorted list of cached components, which includes all cached components in the current web application;

[0007] If the number of components in the sequential list exceeds the component count threshold, then cached components to be destroyed are identified.

[0008] Destroy the cache components to be destroyed.

[0009] Optionally, the step of obtaining the ordered list of cache components includes:

[0010] Retrieve a sorted list based on the access time of the path corresponding to the cached component.

[0011] Optionally, the steps for determining the cache component to be destroyed include:

[0012] Based on the access time of the path, determine the cache components to be destroyed.

[0013] Optionally, based on the path access time, the cache components to be destroyed are determined, including:

[0014] Based on the access time of the path, a preset number of cache components to be destroyed are determined.

[0015] Optionally, the cache components to be destroyed include:

[0016] Retrieve the access path to be destroyed corresponding to the cache component to be destroyed, and destroy the access path to be destroyed.

[0017] Secondly, the present invention also provides a web application cache management device, the device comprising:

[0018] The retrieval module is used to retrieve a sorted list of cached components, which includes all cached components in the current web application.

[0019] The judgment module is used to determine the cached components to be destroyed if the number of components in the sequential list exceeds the component number threshold.

[0020] The destruction module is used to destroy cache components that are to be destroyed.

[0021] Optionally,

[0022] The retrieval module is also used to retrieve a sorted list based on the access time of the path corresponding to the cached component.

[0023] Optionally,

[0024] The judgment module is also used to determine the cache components to be destroyed based on the access time of the path.

[0025] Thirdly, the present invention also provides a web application cache management device, the device comprising: a memory, a processor, and a web application cache management program stored on the memory and executable on the processor, wherein the web application cache management program is configured to implement the steps of any of the web application cache management methods described above.

[0026] Fourthly, the present invention also provides a computer-readable storage medium storing a web application cache management program, which, when executed by a processor, implements the steps of the web application cache management method as described above.

[0027] This invention provides a web application cache management method, apparatus, device, and storage medium, which obtains a sequential list of cache components, the sequential list including all cache components in the current web application; if the number of components in the sequential list exceeds a component number threshold, then cache components to be destroyed are identified; and the cache components to be destroyed are destroyed.

[0028] Therefore, this invention determines the cache components to be destroyed when the number of components in the sequential list of cache components exceeds a component quantity threshold, and then destroys the cache components. This addresses the problem of excessive cache components in web applications by destroying those to be destroyed, controlling the number of cache components on the server, controlling the storage resources occupied by cache components, ensuring the storage resources available for web application operation, and solving the technical problem of web application lag caused by too many currently viewed pages and too many cache components, thus improving the user experience. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0030] Figure 1 This is a schematic diagram of the web application cache management device of the present invention;

[0031] Figure 2 This is a flowchart illustrating the first embodiment of the web application cache management method of the present invention;

[0032] Figure 3 This is a schematic diagram of the modules of the first embodiment of the web application cache management device of the present invention.

[0033] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0035] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0036] In this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that an apparatus or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an apparatus or system. Without further limitation, an element defined by the phrase "comprising..." does not exclude the presence of other identical elements in the apparatus or system that includes that element.

[0037] In web applications developed using the Vue.js front-end framework, using single-page applications (SPAs) and having too many pages can lead to large codebases. In large applications, SPAs place high demands on device performance. When device performance is low, issues such as slow page loading, failure to load required files leading to a blank webpage, and negatively impacting user experience may occur. In such cases, lazy loading can be used. Different routes have their respective cached components that package and load the page's access path. The page is then loaded only when it is needed, effectively reducing the loading pressure on the homepage and shortening its loading time.

[0038] In practice, web applications generally use keep-alive technology for page caching to provide a better user experience. However, if there are too many pages being viewed or too many cached components, it can cause the web application to lag.

[0039] In view of the technical problem that existing web applications experience lag when there are too many currently viewed pages and too many cached components, this invention provides a web application cache management method, the overall idea of ​​which is as follows:

[0040] The method includes: obtaining a sorted list of cached components, which includes all cached components in the current web application; if the number of components in the sorted list exceeds a component count threshold, then identifying the cached components to be destroyed; and destroying the cached components to be destroyed.

[0041] This invention provides a web application cache management method. By determining that the number of components in the sequential list of cached components exceeds a component quantity threshold, a cached component to be destroyed is identified and destroyed. This method controls the number of cached components on the server, manages the storage resources occupied by cached components, and ensures sufficient storage resources for web application operation. It solves the technical problem of web application lag caused by too many currently viewed pages and too many cached components, thus improving the user experience.

[0042] The following provides a detailed description of the web application cache management method, apparatus, device, and storage medium used in the technical implementation of this invention:

[0043] Reference Figure 1 , Figure 1 This is a schematic diagram of the web application cache management device of the present invention;

[0044] like Figure 1 As shown, the device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include user equipment such as a display terminal and a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0045] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0046] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and a web application cache management program.

[0047] exist Figure 1 In the device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with user devices; the processor 1001 and memory 1005 in the web application cache management method of the present invention can be set in the device. The web application cache management method calls the web application cache management program stored in the memory 1005 through the processor 1001 and executes the web application cache management method provided in the embodiment of the present invention.

[0048] The web application cache management method, apparatus, device, and storage medium of the present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0049] Based on, but not limited to, the above hardware structure, refer to Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the web application cache management method of the present invention. This embodiment provides a web application cache management method applied to a server, the method comprising:

[0050] Step S100: Obtain the ordered list of cached components, which includes all cached components in the current web application.

[0051] In this embodiment, the executing entity of the web application cache management method can be a server, which may include a physical server on a standalone host, or a virtual server hosted in a host cluster. The server can be, for example... Figure 1 Web application cache management device.

[0052] It's understandable that a server can connect to a user's device. When a user accesses a new page, the access path can be packaged using the cached component corresponding to the route. The server can then arrange the cached components for different pages in order. Specifically, the server can arrange the cached components according to the access time or number of accesses within the path. In practice, the order of the cached components can be chosen based on requirements. Ideally, the server can arrange the cached components in the order of access times, resulting in a sorted list.

[0053] It should be noted that the server can retrieve the ordered list of cached components at preset intervals, or perform this step when a user visits a new page. In actual use, the choice can be made according to requirements. The preset interval can be set based on the server's storage capacity and / or processor processing capacity.

[0054] Specifically, as one implementation method, step S100 includes: obtaining a sorted list according to the access time of the path corresponding to the cache component.

[0055] In this embodiment, the different cache components corresponding to the access paths of different routes can be stored in the order of access time of the path through the native local storage of the web application to obtain a sorted list.

[0056] In practice, the server retrieves the ordered list of cached components directly from local storage based on the access time of the path.

[0057] Step S200: If the number of components in the sequential list exceeds the component number threshold, then the cached components to be destroyed are identified.

[0058] In this embodiment, the component quantity threshold can be set according to the storage capacity of the local memory and / or the processing capacity of the processor in the server, and can be selected according to actual usage. This embodiment uses a component quantity threshold of 20 for detailed explanation.

[0059] The cache components to be destroyed can be those corresponding to the earliest accessed paths in the sequential list, those corresponding to the least frequently accessed access paths, or other access paths that are least likely to be accessed by users. In practice, the cache components to be destroyed can be determined based on actual needs. Preferably, the cache components to be destroyed are those corresponding to the earliest accessed paths.

[0060] Specifically, as one implementation method, step S200 includes:

[0061] Step S210: Determine the cache components to be destroyed based on the path access time.

[0062] In this embodiment, the cache components in the sorting order table can be arranged according to the order of path access time, and the cache components to be destroyed can be the first cache component in the sorting order table or multiple cache components at the very beginning of the sorting order table. Preferably, the cache components to be destroyed include multiple cache components at the very beginning of the sorting order table.

[0063] In the specific implementation, based on the access time of the access path corresponding to different cache components, the first cache component is determined in the sequential list, and the cache component to be destroyed is obtained.

[0064] Specifically, as one implementation method, step S210 includes: determining a preset number of cache components to be destroyed based on the path access time.

[0065] In this embodiment, the preset number of cache components to be destroyed can be set according to the storage status of the memory in the server and / or the processing status of the processor. This embodiment uses a preset number of 5 for detailed explanation.

[0066] In the specific implementation, based on the access time of the access path corresponding to different cache components, the preset number of cache components at the front of the sequential list are determined to obtain the preset number of cache components to be destroyed.

[0067] Step S300: Destroy the cache component to be destroyed.

[0068] In this embodiment, when destroying a cache component to be destroyed, the access path stored in the cache component to be destroyed can be destroyed, thereby destroying the cache component to be destroyed and releasing the storage space occupied by the cache component to be destroyed.

[0069] Specifically, as one implementation method, step S300 includes: retrieving the access path to be destroyed corresponding to the cache component to be destroyed, and destroying the access path to be destroyed.

[0070] In this embodiment, the deactivated function of the lifecycle of the keep-alive technology can be used to call the access path to be destroyed corresponding to the cache component to be destroyed, and destroy the access path to be destroyed, thereby controlling the number of cache components and keeping the web application running smoothly.

[0071] In one exemplary implementation, the server directly retrieves a sequential list of cached components from local storage based on the access time of the path. It then checks if the number of components in the sequential list exceeds 20. If it does, the server identifies the first 5 cached components in the sequential list based on the access time of the access paths corresponding to different cached components, resulting in 5 cached components to be destroyed. The server then retrieves the access paths corresponding to these 5 cached components to be destroyed and destroys those access paths.

[0072] This embodiment provides a web application cache management method. By determining that the number of components in the sequential list of cached components exceeds a component quantity threshold, cached components to be destroyed are identified and destroyed. This method controls the number of cached components on the server, manages the storage resources occupied by cached components, and ensures sufficient storage resources for web application operation. It solves the technical problem of web application lag caused by too many currently viewed pages and too many cached components, thus improving the user experience.

[0073] This embodiment also obtains a sequential list of cached components based on the path access time, which can directly determine the cached components corresponding to the earlier access paths. This simplifies the process of determining the cached components to be destroyed and saves time in managing web application cached components. Furthermore, by destroying the first few cached components in the sequential list, more storage resources can be freed up, making the web application run more smoothly and further improving the user experience.

[0074] Based on the same inventive concept, embodiments of the present invention also provide a web application cache management device, referring to... Figure 3 , Figure 3 This is a schematic diagram of the modules of the first embodiment of the web application cache management device of the present invention; the device includes:

[0075] Module 10 is used to obtain a sorted list of cached components, which includes all cached components in the current web application.

[0076] Module 20 is used to determine the cached components to be destroyed if the number of components in the sequential list exceeds the component number threshold.

[0077] Destruction module 30 is used to destroy cache components to be destroyed.

[0078] This embodiment provides a web application cache management device. By determining that the number of components in the sequential list of cache components exceeds a component quantity threshold, it identifies cache components to be destroyed and destroys them. This addresses the issue of excessive cache components in a web application by destroying those to be destroyed, controlling the number of cache components on the server, controlling the storage resources occupied by cache components, ensuring sufficient storage resources for web application operation, and solving the technical problem of web application lag caused by too many currently viewed pages and too many cache components, thus improving the user experience.

[0079] Specifically, as one implementation method, the acquisition module 10 is also used to acquire a sorted list according to the access time of the path corresponding to the cache component.

[0080] Specifically, as one implementation method, the judgment module 20 is also used to determine the cache component to be destroyed based on the path access time.

[0081] Specifically, as another implementation method, the judgment module 20 is also used to determine a preset number of cache components to be destroyed based on the path access time.

[0082] Specifically, as one implementation method, the destruction module 30 is also used to retrieve the access path to be destroyed corresponding to the cache component to be destroyed, and destroy the access path to be destroyed.

[0083] This embodiment provides a web application cache management device. By obtaining a sequential list of cache components based on the access time of the path, the device can directly determine the cache component corresponding to the earlier access path, simplifying the process of identifying cache components to be destroyed and saving time in managing web application cache components. Furthermore, by destroying the first few cache components in the sequential list, more storage resources can be freed up, making the web application run more smoothly and further improving the user experience.

[0084] For more details on the specific implementation of the above-mentioned web application cache management device, please refer to the description of the specific implementation of the web application cache management method in the above embodiments. For the sake of brevity, these details will not be repeated here.

[0085] Furthermore, embodiments of the present invention also propose a computer storage medium storing a web application cache management program. When the web application cache management program is executed by a processor, it implements the steps of the web application cache management method described above. Therefore, it will not be repeated here. Additionally, the beneficial effects of using the same method will not be repeated here either. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed to execute on a single computing device, or on multiple computing devices located at one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0086] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0087] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for managing cache of web applications, the method comprising: The method applied to a server comprises: The server acquires a sequential list of cache components every preset time or performs the step of acquiring the sequential list of cache components when a user accesses a new page, the sequential list comprising all cache components in a current web application, wherein the step of acquiring the sequential list of cache components comprises acquiring the sequential list according to path access time of the cache components; If the number of components in the sequential list exceeds a component number threshold, a preset number of cache components to be destroyed are determined according to the path access time; The cache components to be destroyed are destroyed, wherein the step of destroying the cache components to be destroyed comprises: The destroyed access path corresponding to the cache components to be destroyed is called by a life cycle deactivated function of keep-alive technology, and the destroyed access path is destroyed.

2. A web application cache management apparatus characterized by comprising: The device comprises: An acquisition module configured to acquire a sequential list of cache components every preset time or perform the step of acquiring the sequential list of cache components when a user accesses a new page, the sequential list comprising all cache components in a current web application, wherein the acquisition module is specifically configured to acquire the sequential list according to path access time of the cache components; A judgment module configured to determine a preset number of cache components to be destroyed according to the path access time if the number of components in the sequential list exceeds a component number threshold; A destruction module configured to destroy the cache components to be destroyed, wherein the destruction module is further configured to call the destroyed access path corresponding to the cache components to be destroyed by a life cycle deactivated function of keep-alive technology, and destroy the destroyed access path.

3. A web application cache management device, characterized by, The device comprises a memory, a processor, and a web application cache management program stored on the memory and executable on the processor, and the steps of the web application cache management method according to claim 1 are configured to be implemented by the web application cache management program.

4. A computer-readable storage medium, characterized in that, The storage medium stores the web application cache management program, and the steps of the web application cache management method according to claim 1 are implemented when the web application cache management program is executed by the processor.

Citation Information

Patent Citations

  • A method for realizing multi-page switching based on vue

    CN109241469A