Website page loading method and device
By preloading and caching through built-in framework components on the website's front-end pages and browser caching mechanisms, the problem of slow initial website access speed in existing technologies is solved. This enables the early caching of static resources and dynamic interface data, thereby improving the initial website access speed.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING JINGDONG YUANSHENG TECH CO LTD
- Filing Date
- 2024-11-11
- Publication Date
- 2026-05-12
AI Technical Summary
Existing preloading solutions offer limited speed-up during the first visit to a website, especially for pages containing dynamic or personalized content, where they cannot accurately capture and render the content, and they also increase the network overhead of the initial page load.
By embedding frame components in the website's front-end pages, the browser's caching mechanism is used to preload and cache static resources and dynamic interface data. This includes embedding iframe components in the front-end pages to hide requests and using Service Workers for offline caching. Different caching strategies are employed to manage different types of data requests.
It achieves high-speed loading on the first visit to the website by caching static resources and dynamic interface data in advance, reducing network request latency and improving user experience.
Smart Images

Figure CN122019897A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for loading website pages. Background Technology
[0002] Preloading, a crucial technique for accelerating website loading, primarily involves retrieving pre-downloaded resources from the cache immediately, without relying on network requests. This significantly improves application loading speed and responsiveness. Current preloading implementations include pre-caching, pre-rendering, and retrieving resources in advance during page loading, among others.
[0003] However, existing preloading solutions typically occur on secondary pages after the website is opened, which has a very limited speed-up effect on first visits. At the same time, they cannot accurately capture and render pages containing dynamic or personalized content, thus greatly reducing the effectiveness of preloading. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a method and apparatus for loading website pages, which can preload and cache website page data through a frame component built into the website's front-end page, and load website pages based on the preloaded and cached page data, greatly improving the access speed of the website on the first visit.
[0005] To achieve the above objectives, according to one aspect of the present invention, a method for loading a website page is provided, comprising: In response to opening the website's front page, a website page access request is sent through the framework component built into the front page to load the website page's data, and the website page's data is cached through the browser's caching mechanism. The website page's data includes static resource data and dynamic interface data. In response to opening a website page, retrieve the website page data from the cached data and perform validation; Upon successful verification, the website page is loaded based on the retrieved website page data.
[0006] Optionally, the method further includes: in response to the website not having a front page, adding a front page to the website, embedding a frame component in the front page, and hiding the frame component.
[0007] Optionally, a website page access request is sent through a frame component built into the front-end page, including: obtaining the website page access address from the resource path attribute of the frame component built into the front-end page; and sending the website page access request to the access address through the frame component.
[0008] Optionally, the website page data can be cached through the browser's caching mechanism, including: caching the website page data by activating an offline caching component through the browser's caching mechanism.
[0009] Optionally, in response to opening a website page, the website page data is retrieved from cached data and validated, including: in response to opening a website page, retrieving the resource path corresponding to the static resource data of the website page and the interface identifier corresponding to the dynamic interface data; validating the resource path based on whether it includes a specified checksum; in response to the resource path including a specified checksum, retrieving the static resource data of the website page from cached data; retrieving the dynamic interface data of the website page from cached data based on the interface identifier, and validating the dynamic interface data by determining whether it has expired.
[0010] Optionally, the method further includes: in response to the resource path not containing a specified checksum, generating a static resource data acquisition request and acquiring static resource data according to the resource path; in response to the dynamic interface data being expired, generating a dynamic interface data acquisition request and acquiring dynamic interface data according to the interface identifier.
[0011] According to another aspect of the present invention, a website page loading device is provided, comprising: The data preloading and caching module is used to respond to the opening of the website's front page. It sends a website page access request through the framework component built into the front page to load the website page data, and caches the website page data through the browser's caching mechanism. The website page data includes static resource data and dynamic interface data. The data acquisition and verification module is used to retrieve and verify the data of the website page from the cached data in response to opening the website page; The page loading module is used to load the website page based on the obtained website page data in response to successful verification.
[0012] According to another aspect of the present invention, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the website page loading method provided in the embodiments of the present invention.
[0013] According to another aspect of the present invention, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the website page loading method provided in the embodiments of the present invention.
[0014] According to another aspect of the present invention, a computer program product is provided, including a computer program that, when executed by a processor, implements the website page loading method provided in the embodiments of the present invention.
[0015] One embodiment of the above invention has the following advantages or beneficial effects: by responding to opening the website's front-end page, sending a website page access request to load website page data through the frame component built into the front-end page, and caching the website page data through the browser's caching mechanism, the website page data includes static resource data and dynamic interface data; responding to opening the website page, retrieving the website page data from the cached data and verifying it; and responding to successful verification, loading the website page based on the retrieved website page data, the technical solution realizes the pre-loading and caching of the website page's static resources and dynamic interface data through the frame component built into the website's front-end page, and loading the website page based on the pre-loaded and cached website page data, greatly improving the access speed of the website on the first visit.
[0016] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0017] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein: Figure 1 This is a schematic diagram illustrating the main steps of a website page loading method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the logic for obtaining static resource data according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the dynamic interface data acquisition logic according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the website page loading process according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the main modules of a website page loading device according to an embodiment of the present invention; Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied; Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0018] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0019] It should be noted that the technical solutions disclosed in this invention, regarding the collection, updating, analysis, processing, use, transmission, and storage of user personal information, all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0020] Currently, most website preloading solutions involve preloading, caching, or rendering resources only after the website has been opened. However, these methods can only cache static resources, not dynamic ones. Therefore, they can only improve page loading speed to a certain extent and within a limited scope, failing to achieve true dynamic acceleration. Furthermore, they increase the network overhead of the initial page loading when a user first enters the website. Thus, these solutions cannot solve the problem of improving access speed during the first visit to a website. Therefore, this invention provides a website page loading method that primarily addresses how to utilize preloading capabilities to improve the speed of the first visit to a website.
[0021] In the description of the embodiments of the present invention, the technical terms involved and their definitions are as follows.
[0022] Preloading: This refers to website preloading, which means loading some key content before the entire webpage is loaded, in order to provide users with a better experience and reduce waiting time.
[0023] Service Worker: A script that runs in a web browser, independent of the webpage context, and can continue to run in the background after the user closes the webpage. It is mainly used for persistent offline caching.
[0024] Iframe: Iframe is an HTML (Hypertext Markup Language) tag used to insert a new document into a document, or to insert a floating frame into a document. The Iframe element creates an inline frame (i.e., an inline frame) that contains another document.
[0025] js: short for JavaScript language.
[0026] Hash: Generally translated as hashing, hashing, or transliterated as hash, it is a function that transforms an input of arbitrary length into a fixed-length output through a hash algorithm. This output is called the hash value. Simply put, it is a function that compresses a message of arbitrary length into a message digest of a certain fixed length.
[0027] Figure 1 This is a schematic diagram illustrating the main steps of a website page loading method according to an embodiment of the present invention. Figure 1 As shown, the website page loading method of this embodiment mainly includes the following steps S101 to S103.
[0028] Step S101: In response to opening the website's front page, a website page access request is sent through the framework component built into the front page to load the website page's data, and the website page's data is cached through the browser's caching mechanism. The website page's data includes static resource data and dynamic interface data.
[0029] According to one embodiment of the present invention, the method for loading a website page further includes: in response to the website not having a foreground page, adding a foreground page to the website, embedding a frame component in the foreground page, and hiding the frame component. The hiding process ensures that the user is unaware of the frame component and cannot see its content.
[0030] A front page refers to the content a user sees before opening the main page of a website. Typically, a main website will have a front page, such as a login page, advertising page, countdown page, or promotional page. If there isn't one, a front page can be added. These front pages are usually simple, with few functions and few dependencies, allowing for extremely fast loading.
[0031] In one embodiment of the present invention, an Iframe can be embedded in the pre-view page and hidden so that the user cannot perceive it. An Iframe, relative to the page, is a page component element; it is a special component that can independently request and load pages from other websites. Its role here is to use the Iframe to pre-initiate a request to the server and load the main website page within the pre-view page. Hiding it prevents the user from seeing the content of the main website page on the pre-view page. When the user navigates to the main website page through the pre-view page, the browser, having already pre-loaded the main website page, will be very fast when making a second request to the server to load it. The hiding method is similar to hiding other page elements and can take various forms, such as setting the style attribute to none, setting the Iframe's width and height to zero, setting the Iframe's position to absolute to create an absolutely positioned element, or setting the Iframe's left offset to -9999 pixels, etc. In other embodiments of the present invention, the Iframe can be replaced with a webview or webContainer, or other containers capable of loading website pages.
[0032] According to one embodiment of the present invention, sending a website page access request through a frame component built into the front-end page can specifically include: obtaining the website page access address from the resource path attribute of the frame component built into the front-end page; and sending the website page access request to the access address through the frame component. The iframe component element has a src attribute (i.e., a resource path attribute). By directly assigning the website page access address to src, the website page access request can be sent through the frame component to load the website page data.
[0033] After the website page data is loaded, the data can be cached using the browser's caching mechanism. Specifically, this includes activating an offline caching component to cache the website page data using the browser's caching mechanism. In embodiments of this invention, this offline caching component is, for example, a Service Worker.
[0034] After loading the website page's data, a Service Worker is started in the website page's code to cache the website page's static resources and dynamic API data in the local database and local cache. To prevent scope pollution, all active Service Workers need to be unregistered before installing the Service Worker. Specifically, when starting the Service Worker, it can first check if the current browser supports starting Service Workers. If it does, all registered Service Worker tasks are unregistered, and then the Service Worker on this website is registered. The registration logic is: load a JavaScript file from this website through the registration interface provided by the Service Worker. After registering the Service Worker on this website, it can be started to cache the website page's static resources and dynamic API data.
[0035] According to one embodiment of the present invention, when caching website page data through the browser's caching mechanism, the static resource data and dynamic interface data of the website page are cached through the browser's caching mechanism.
[0036] In embodiments of this invention, page requests can be divided into four parts: HTML requests, JS / CSS (Cascading Style Sheets) requests, image requests, and API requests. Caching strategies are applied to the data corresponding to these four types of requests. If the data is not cached, it must be directly requested from the server, which is inefficient. If the data is cached, the request can be redirected to a Service Worker, which provides the response based on the caching strategy. Different caching strategies can be used for the data corresponding to different requests.
[0037] For HTML requests, a Network First caching strategy is adopted, which means that by default, it will try to fetch the latest request from the network. If the request is successful, it will put the response into the cache; if the network cannot return a response, the cached response will be used.
[0038] For API requests, a Stale-While-Revalidate caching strategy is used. Specifically, data is first requested from the cache and a response is generated. Simultaneously, a network request for data is made immediately. The network request has a slight delay, and the cache is updated after the network data is received. This is a common caching strategy suitable for content that is frequently updated but not critically important (at least one cache read is allowed). This strategy ensures that the client receives the data immediately while simultaneously requesting network resources to update the cache, guaranteeing that the next time the client reads the data from the cache, it is up-to-date. Therefore, this mode does not reduce the access pressure on the backend server, but it provides a fast response experience for frontend users.
[0039] For requests to static resources, a Cache First caching strategy is adopted. Specifically, if the response is in the cache, the cached response will be used to complete the request, and the network will not be used at all. If the response is not in the cache, the data will be obtained through a network request to satisfy the request, and the response data will be cached so that the next request can directly read the latest cached data.
[0040] Step S102: In response to opening the website page, retrieve the website page data from the cached data and perform verification.
[0041] According to one embodiment of the present invention, in response to opening a website page, retrieving and verifying the website page data from cached data may specifically include: in response to opening a website page, retrieving the resource path corresponding to the static resource data of the website page and the interface identifier corresponding to the dynamic interface data; performing verification based on whether the resource path includes a specified checksum; in response to the resource path including the specified checksum, retrieving the static resource data of the website page from cached data; retrieving the dynamic interface data of the website page from cached data based on the interface identifier, and performing verification by determining whether the dynamic interface data has expired.
[0042] Figure 2This is a schematic diagram illustrating the logic for obtaining static resource data according to an embodiment of the present invention. In this embodiment, a hash value can be added to the resource path of the static resource data to include files with hash characters in HTML files. When a website page is opened and static resource data is requested, the Service Worker intercepts the request and determines whether the resource path of the static resource data in the request contains a hash character. It then searches for the cache using the path containing the hash character and determines whether the cache for the static resource data exists. If the cache exists, the cached static resource data is used directly to respond to the request; if the cache does not exist, the static resource data is obtained through a network request, and the response to that request is executed. If the resource path of the static resource data in the request does not contain a hash character, it indicates that the static resource data is not cached, and the static resource data is obtained directly through a network request, and the response to that request is executed.
[0043] In other embodiments of the present invention, hash character verification can also be replaced by data primary key verification, timestamp verification, or encryption / decryption verification, etc.
[0044] Figure 3 This is a schematic diagram illustrating the logic for acquiring dynamic interface data according to an embodiment of the present invention. In this embodiment, the logic for acquiring dynamic interface data is as follows: Assuming a known cache expiration time (e.g., 5 minutes), when a website page is opened and dynamic interface data is requested, the Service Worker intercepts the interface request. It then checks the cache to determine if the cached dynamic interface data exists. If it exists, it compares the expiration time to determine if the cache has expired. If it has, the cache has expired, and a network request is made directly, pushing the requested dynamic interface data into the cache, and then retrieving the dynamic interface data from the cache for the response. Otherwise, if the expiration time has not exceeded the set time, the cached dynamic interface data is retrieved for the response. If the cached dynamic interface data does not exist, a network request is made directly, pushing the requested dynamic interface data into the cache, and then retrieving the dynamic interface data from the cache for the response.
[0045] Step S103: In response to successful verification, load the website page based on the obtained website page data.
[0046] According to an embodiment of the present invention, the method further includes: in response to the resource path not including a specified checksum, generating a static resource data acquisition request and acquiring static resource data according to the resource path; in response to the dynamic interface data being expired, generating a dynamic interface data acquisition request and acquiring dynamic interface data according to the interface identifier.
[0047] If the specified checksum is not included in the resource path, it indicates that the static resource data is not cached. In this case, a static resource data retrieval request will be generated, and the static resource data will be retrieved based on the resource path. Similarly, if the dynamic interface data has expired, a dynamic interface data retrieval request will be generated, and the dynamic interface data will be retrieved based on the interface identifier.
[0048] Figure 4 This is a schematic diagram of the website page loading process according to an embodiment of the present invention. Figure 4 As shown, in one embodiment of the present invention, the website page loading process is as follows: The user enters a pre-website, embeds a hidden iframe within the pre-website, and requests access to the main website within the iframe. After the main website starts, a Service Worker is used to cache the website's static resources and dynamic interface data. At this time, the user can browse other content. After the user enters the main website, it is determined whether the cache exists, and the cached static resources and dynamic interface data are searched and verified. If the cache exists and is available, the cache is directly read to preload the website page; if the cache does not exist or is unavailable, normal loading is performed.
[0049] Figure 5 This is a schematic diagram of the main modules of a website page loading device according to an embodiment of the present invention. Figure 5 As shown, the website page loading device 500 of this embodiment mainly includes a data preloading cache module 501, a data acquisition and verification module 502, and a page loading module 503.
[0050] The data preloading cache module 501 is used to respond to the opening of the website's front page by sending a website page access request through the framework component built into the front page to load the website page data, and to cache the website page data through the browser's caching mechanism. The website page data includes static resource data and dynamic interface data. The data acquisition and verification module 502 is used to retrieve and verify the data of the website page from the cached data in response to opening the website page; The page loading module 503 is used to load the website page based on the obtained website page data in response to the successful verification.
[0051] According to one embodiment of the present invention, the website page loading device 500 may further include a front page adding module (not shown in the figure), which is used to add a front page to the website in response to the absence of a front page, embed a frame component in the front page, and hide the frame component.
[0052] According to another embodiment of the present invention, the data preloading cache module 501 can also be used to: obtain the access address of the website page from the resource path attribute of the frame component built into the front page; and send a website page access request to the access address through the frame component.
[0053] According to another embodiment of the present invention, the data preloading cache module 501 can also be used to: activate an offline caching component to cache the data of the website page through the browser's caching mechanism.
[0054] According to another embodiment of the present invention, the data acquisition and verification module 502 can also be used to: in response to opening a website page, acquire the resource path corresponding to the static resource data of the website page and the interface identifier corresponding to the dynamic interface data; perform verification based on whether the resource path includes a specified checksum; in response to the resource path including a specified checksum, acquire the static resource data of the website page from the cached data; acquire the dynamic interface data of the website page from the cached data based on the interface identifier, and perform verification by determining whether the dynamic interface data has expired.
[0055] According to another embodiment of the present invention, the data acquisition verification module 502 can also be used to: generate a static resource data acquisition request in response to the resource path not including the specified checksum, and acquire static resource data according to the resource path; generate a dynamic interface data acquisition request in response to the dynamic interface data being expired, and acquire dynamic interface data according to the interface identifier.
[0056] According to the technical solution of the present invention, in response to opening a website's front-end page, a website page access request is sent through a frame component built into the front-end page to load website page data, and the website page data is cached through the browser's caching mechanism. The website page data includes static resource data and dynamic interface data. In response to opening a website page, the website page data is retrieved from the cached data and verified. In response to successful verification, the website page is loaded based on the retrieved website page data. This technical solution achieves pre-loading and caching of static resources and dynamic interface data of the website page through a frame component built into the website's front-end page, and loads the website page based on the pre-loaded and cached website page data, greatly improving the access speed of the website on the first visit.
[0057] Figure 6 An exemplary system architecture 600 is shown, to which the website page loading method or website page loading apparatus of embodiments of the present invention can be applied.
[0058] like Figure 6As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0059] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0060] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0061] Server 605 can be a server providing various services, such as a backend management server supporting websites browsed by users using terminal devices 601, 602, and 603 (for example only). The backend management server can respond to received website page loading requests and other data by: opening a website's front-end page; sending website page access requests to load website page data through the front-end page's built-in framework components; caching website page data through the browser's caching mechanism; retrieving website page data from the cache and validating it upon opening the website page; and performing processing such as loading the website page based on the retrieved data upon successful verification, and feeding back the processing result (e.g., the loaded website page – for example only) to the terminal device.
[0062] It should be noted that the website page loading method provided in the embodiments of the present invention is generally executed by server 605, and correspondingly, the website page loading device is generally set in server 605.
[0063] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0064] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing terminal devices or servers of the present invention. Figure 7The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0065] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0066] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0067] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.
[0068] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0069] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0070] The units or modules described in the embodiments of the present invention can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor may be described as including a data preloading cache module, a data acquisition and verification module, and a page loading module. The names of these units or modules do not necessarily limit the specific unit or module itself; for example, a page loading module may also be described as "a module for loading a website page based on the acquired website page data in response to a successful verification."
[0071] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to: in response to opening a front-end page of a website, send a website page access request to load website page data through a frame component built into the front-end page, and cache the website page data through a browser caching mechanism, wherein the website page data includes static resource data and dynamic interface data; in response to opening the website page, retrieve the website page data from the cached data and perform verification; and in response to successful verification, load the website page based on the retrieved website page data.
[0072] According to the technical solution of the present invention, in response to opening a website's front-end page, a website page access request is sent through a frame component built into the front-end page to load website page data, and the website page data is cached through the browser's caching mechanism. The website page data includes static resource data and dynamic interface data. In response to opening a website page, the website page data is retrieved from the cached data and verified. In response to successful verification, the website page is loaded based on the retrieved website page data. This technical solution achieves pre-loading and caching of static resources and dynamic interface data of the website page through a frame component built into the website's front-end page, and loads the website page based on the pre-loaded and cached website page data, greatly improving the access speed of the website on the first visit.
[0073] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for loading a website page, characterized in that, include: In response to opening the website's front page, a website page access request is sent through the framework component built into the front page to load the website page's data, and the website page's data is cached through the browser's caching mechanism. The website page's data includes static resource data and dynamic interface data. In response to opening the website page, retrieve the data of the website page from the cached data and perform verification; Upon successful verification, the website page is loaded based on the obtained website page data.
2. The method according to claim 1, characterized in that, The method further includes: In response to the lack of a front page on the website, a front page is added to the website, a frame component is embedded in the front page, and the frame component is hidden.
3. The method according to claim 1, characterized in that, Sending website page access requests through the frame components built into the front-end page includes: Obtain the website page's access address from the resource path attribute of the frame component built into the front page; The framework component sends a website page access request to the access address.
4. The method according to claim 1, characterized in that, Cache the data of the website page using the browser's caching mechanism, including: By utilizing the browser's caching mechanism, an offline caching component is activated to cache the data on the website pages.
5. The method according to claim 1, characterized in that, In response to opening the website page, the system retrieves and validates the data of the website page from the cached data, including: In response to opening the website page, obtain the resource path corresponding to the static resource data of the website page and the interface identifier corresponding to the dynamic interface data; The system performs a checksum verification based on whether the resource path includes a specified checksum. If the resource path includes a specified checksum, the system retrieves the static resource data of the website page from the cached data. The dynamic interface data of the website page is obtained from the cached data according to the interface identifier, and the dynamic interface data is verified by determining whether it has expired.
6. The method according to claim 5, characterized in that, The method further includes: In response to the fact that the specified checksum is not included in the resource path, a static resource data retrieval request is generated, and static resource data is retrieved according to the resource path; In response to the expiration of the dynamic interface data, a dynamic interface data retrieval request is generated, and the dynamic interface data is retrieved based on the interface identifier.
7. A website page loading device, characterized in that, include: The data preloading caching module is used to respond to the opening of the website's front page by sending a website page access request through the framework component built into the front page to load the website page's data, and to cache the website page's data through the browser's caching mechanism. The website page's data includes static resource data and dynamic interface data. The data acquisition and verification module is used to retrieve and verify the data of the website page from the cached data in response to opening the website page; The page loading module is used to load the website page based on the obtained website page data in response to the successful verification.
8. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.
9. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.