Search

CN-122019897-A - Method and device for loading website pages

CN122019897ACN 122019897 ACN122019897 ACN 122019897ACN-122019897-A

Abstract

The invention discloses a loading method and device of a website page, and relates to the technical field of computers. The method comprises the steps of responding to opening a preposed page of a website, sending a website page access request through a frame component built in the preposed page to load data of the website page, caching the data of the website page through a caching mechanism of a browser, acquiring the data of the website page from the cached data and checking in response to opening the website page, and loading the website page according to the acquired data of the website page in response to checking passing. According to the embodiment, the static resources and the dynamic interface data of the website page are preloaded and cached through the built-in frame component in the front page of the website, and the website page is loaded based on the preloaded and cached website page data, so that the access speed of the website when the website is accessed for the first time is greatly improved.

Inventors

  • HU XIONGWEI

Assignees

  • 北京京东远升科技有限公司

Dates

Publication Date
20260512
Application Date
20241111

Claims (10)

  1. 1. The loading method of the website page is characterized by comprising the following steps: Responding to a preposed page of an opened website, sending a website page access request through a frame component arranged in the preposed page to load data of the website page, and caching the data of the website page through a caching mechanism of a browser, wherein the data of the website page comprises static resource data and dynamic interface data; responding to the opening of the website page, acquiring data of the website page from the cache data and checking; and responding to the verification, and loading the website page according to the acquired data of the website page.
  2. 2. The method according to claim 1, wherein the method further comprises: And in response to the website not having the prepositive page, adding the prepositive page for the website, embedding a frame component in the prepositive page, and hiding the frame component.
  3. 3. The method of claim 1, wherein sending a web page access request through the pre-page built-in framework component comprises: acquiring an access address of a website page from a resource path attribute of a frame component built in the front page; And sending a website page access request to the access address through the framework component.
  4. 4. The method of claim 1, wherein caching the data of the web site page by a caching mechanism of a browser comprises: and starting an offline caching component to cache the data of the website page through a caching mechanism of the browser.
  5. 5. The method of claim 1, wherein in response to opening the web page, retrieving and verifying data of the web page from cached data comprises: Responding to the opening of the website page, and acquiring a resource path corresponding to static resource data of the website page and an interface identifier corresponding to dynamic interface data; checking according to whether the resource path comprises a specified check character or not, and acquiring static resource data of the website page from cache data in response to the fact that the resource path comprises the specified check character; And acquiring dynamic interface data of the website page from the cache data according to the interface identifier, and checking by judging whether the dynamic interface data is out of date.
  6. 6. The method of claim 5, wherein the method further comprises: Generating a static resource data acquisition request in response to the fact that the resource path does not comprise the specified check symbol, and acquiring static resource data according to the resource path; And generating a dynamic interface data acquisition request in response to the expiration of the dynamic interface data, and acquiring the dynamic interface data according to the interface identifier.
  7. 7. A loading device for web pages, comprising: The data preloading cache module is used for responding to the opening of a preposed page of a website, sending a website page access request through a frame component arranged in the preposed page to load data of the website page, and caching the data of the website page through a cache mechanism of a browser, wherein the data of the website page comprises static resource data and dynamic interface data; the data acquisition and verification module is used for responding to the opening of the website page, acquiring the data of the website page from the cache data and verifying the data; And the page loading module is used for responding to the verification and loading the website page according to the acquired data of the website page.
  8. 8. An electronic device, comprising: one or more processors; storage means for storing one or more programs, When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
  9. 9. A computer readable medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any of claims 1-6.
  10. 10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-6.

Description

Method and device for loading website pages Technical Field The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for loading a website page. Background Preloading is an important technology for accelerating website opening, mainly by acquiring resources downloaded in advance from a cache immediately without relying on network requests, and can remarkably improve the loading speed and responsiveness of an application. Examples of current implementations of preloading are pre-caching, pre-rendering web pages, pre-fetching resources during page loading, and so on. However, the existing preloading scheme usually occurs on a secondary page after the website is opened, so that the acceleration effect on the first access is very limited, and meanwhile, the page containing dynamic or personalized content cannot be accurately captured and presented, so that the preloading effect is greatly reduced. Disclosure of Invention In view of the above, the embodiments of the present invention provide a method and an apparatus for loading a website page, which can perform preloading and caching on website page data through a frame component built in a front page of a website, and perform website page loading based on the preloading and cached page data, so that the access speed of the website when first accessing is greatly improved. In order to achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a method for loading a website page, including: Responding to the opening of a preposed page of a website, sending a website page access request through a frame component arranged in the preposed page to load data of the website page, and caching the data of the website page through a caching mechanism of a browser, wherein the data of the website page comprises static resource data and dynamic interface data; Responding to the opening of the website page, acquiring data of the website page from the cache data and checking; and responding to the verification, and loading the website page according to the acquired data of the website page. Optionally, the method further comprises adding a pre-page to the website in response to the website not having the pre-page, embedding a frame component in the pre-page, and hiding the frame component. Optionally, the website page access request is sent through a frame component built in the front page, wherein the website page access request comprises the steps of acquiring an access address of a website page from a resource path attribute of the frame component built in the front page, and sending the website page access request to the access address through the frame component. Optionally, caching the data of the website page through a caching mechanism of the browser comprises starting an offline caching component to cache the data of the website page through the caching mechanism of the browser. Optionally, the method comprises the steps of responding to the opening of a website page, obtaining data of the website page from the cache data and checking, wherein the method comprises the steps of responding to the opening of the website page, obtaining a resource path corresponding to static resource data of the website page and an interface identifier corresponding to dynamic interface data, checking according to whether a specified check symbol is included in the resource path, responding to the fact that the resource path includes the specified check symbol, obtaining the static resource data of the website page from the cache data, obtaining the dynamic interface data of the website page from the cache data according to the interface identifier, and judging whether the dynamic interface data is out of date or not to check. Optionally, the method further comprises the steps of generating a static resource data acquisition request according to the resource path and acquiring static resource data according to the resource path in response to the fact that the specified verifier is not included in the resource path, generating a dynamic interface data acquisition request according to the fact that the dynamic interface data are out of date, and acquiring the dynamic interface data according to the interface identification. According to another aspect of the embodiment of the present invention, there is provided a loading device for a website page, including: The data preloading cache module is used for responding to the opening of a preposed page of a website, sending a website page access request through a frame component arranged in the preposed page to load data of the website page, and caching the data of the website page through a cache mechanism of a browser, wherein the data of the website page comprises static resource data and dynamic interface data; The data acquisition and verification module is used for responding to the opening of the website page, acquiring the