CN108280105B - HTTP caching method and device and user terminal - Google Patents

HTTP caching method and device and user terminal Download PDF

Info

Publication number
CN108280105B
CN108280105B CN201710133829.2A CN201710133829A CN108280105B CN 108280105 B CN108280105 B CN 108280105B CN 201710133829 A CN201710133829 A CN 201710133829A CN 108280105 B CN108280105 B CN 108280105B
Authority
CN
China
Prior art keywords
http
webpage
page
external picture
caching
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
CN201710133829.2A
Other languages
Chinese (zh)
Other versions
CN108280105A (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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201710133829.2A priority Critical patent/CN108280105B/en
Publication of CN108280105A publication Critical patent/CN108280105A/en
Application granted granted Critical
Publication of CN108280105B publication Critical patent/CN108280105B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides an http caching method, an http caching device and a user terminal, and relates to the technical field of browsers. According to the http caching method, the http caching device and the user terminal, page parsing is carried out by acquiring data of a webpage to generate a DOM tree, the page structure of the webpage is determined according to the data of the DOM tree, and the http caching strategy of the external image resources is determined according to the characteristics of the external image resources loaded through a network and the page structure of the webpage where the external image resources are located. According to the invention, by setting a corresponding http cache strategy for the external connection picture resource, unnecessary capacity consumption of the http cache can be reduced, the webpage loading speed is effectively increased, and the user browsing experience is better.

Description

HTTP caching method and device and user terminal
Technical Field
The invention relates to the technical field of browsers, in particular to an http caching method, an http caching device and a user terminal.
Background
Mobile browsers are the primary tool for mobile terminal (smartphone/tablet) users to browse mobile internet web pages. The http cache is a mechanism for locally storing the web page resource which can be cached (or needs to be checked) by the mobile browser, and the mobile browser judges whether the web page resource is subjected to the http cache or not based on the cache information of the http response header. If the webpage resources are cacheable (or need to be checked), the mobile browser performs http caching on the webpage resources according to the calculated cacheable time, and when the same webpage resources need to be loaded in subsequent webpage browsing, cache data can be directly used (for the webpage resources needing to be checked, the mobile browser also needs to negotiate with the server whether the webpage resources change, if so, newly loaded data is used, otherwise, the http cache data is used), so that traffic consumption caused by loading the same webpage resources from the server can be avoided, and the response speed of the webpage browsing is increased.
However, the storage of the http cache has capacity limitation, and when the capacity limitation is reached, if new http cache data needs to be stored, the http cache system eliminates the http cache data which is not used for the longest time according to a certain strategy, so as to ensure that enough space is available for storing the new http cache data. For some pages with lower access frequency, after the mobile browser performs http caching on the external picture resources carried in the page, the user may not access the page again and reuse the external picture resources, so that caching the external picture resources is actually unnecessary capacity consumption, thereby increasing the trigger probability of eliminating scenes, enabling data which is necessary to be cached to be easily eliminated, affecting the webpage loading speed, and causing poor browsing experience of the user.
Disclosure of Invention
The invention aims to provide an http caching method and an http caching device to solve the problems.
It is also an object of the present invention to provide a user terminal to improve the above problems.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides an http caching method, where the http caching method includes: acquiring data of a webpage, and performing page analysis to generate a DOM tree; determining the page structure of the webpage according to the data of the DOM tree; and determining an http cache strategy of the external picture resource according to the characteristics of the external picture resource loaded through the network and the page structure of the webpage where the external picture resource is located.
In a second aspect, an embodiment of the present invention further provides an http caching apparatus, where the http caching apparatus includes: the page analysis module is used for acquiring data of the webpage and carrying out page analysis to generate a DOM tree; the webpage detection module is used for determining the page structure of the webpage according to the data of the DOM tree; and the cache strategy determining module is used for determining the http cache strategy of the external picture resources according to the characteristics of the external picture resources loaded through the network and the page structure of the webpage where the external picture resources are located.
In a third aspect, an embodiment of the present invention further provides a user terminal, where the user terminal includes: a memory; a processor; and
an http caching apparatus stored in the memory and including one or more software functional modules executed by the processor, the http caching apparatus comprising: the page analysis module is used for acquiring data of the webpage and carrying out page analysis to generate a DOM tree; the webpage detection module is used for determining the page structure of the webpage according to the data of the DOM tree; and the cache strategy determining module is used for determining the http cache strategy of the external picture resources according to the characteristics of the external picture resources loaded through the network and the page structure of the webpage where the external picture resources are located.
Compared with the prior art, the invention has the following beneficial effects: according to the http caching method, the http caching device and the user terminal, page parsing is carried out by acquiring data of a webpage to generate a DOM tree, the page structure of the webpage is determined according to the data of the DOM tree, and the http caching strategy of the external image resources is determined according to the characteristics of the external image resources loaded through a network and the page structure of the webpage where the external image resources are located. According to the invention, the corresponding http cache strategy is set for the external connection picture resource, so that the webpage loading speed can be effectively increased, and the user browsing experience is better.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows an application environment schematic diagram of an http caching method, an http caching device and a user terminal provided by the embodiment of the present invention.
Fig. 2 shows a block diagram of a user terminal according to an embodiment of the present invention.
Fig. 3 shows a functional block diagram of an http caching apparatus according to a first embodiment of the present invention.
Fig. 4 shows a flowchart of an http caching method according to a second embodiment of the present invention.
Icon: 100-a user terminal; 200-a server; 300-a network; 110-a memory; 120-a memory controller; 130-a processor; 140-peripheral interfaces; 150-a radio frequency unit; 160-an audio unit; 170-touch screen; 400-http caching means; 410-a page resolution module; 420-web page detection module; 430-cache policy determination module; 440-web page display module.
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. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
The http caching method, the http caching device and the user terminal provided by the embodiment of the invention can be applied to the application environment shown in fig. 1. As shown in fig. 1, the user terminal 100 and the server 200 are located in a network 300, and the user terminal 100 and the server 200 perform data interaction through the network 300. In the embodiment of the present invention, at least one Application (APP), such as a browser, is installed in the user terminal 100, and corresponds to the server 200 to provide services for the user.
In the embodiment of the present invention, the user terminal 100 may be, but is not limited to, an electronic device such as a mobile phone, a tablet computer, a Mobile Internet Device (MID), and the like.
Fig. 2 shows a block diagram of a user terminal 100, which is applicable to the http caching method and apparatus according to the embodiment of the present invention. As shown in fig. 2, the user terminal 100 may include a memory 110, a memory controller 120, a processor 130, a peripheral interface 140, a radio unit 150, an audio unit 160, and a touch screen 170. The memory 110, the memory controller 120, the processor 130, the peripheral interface 140, the rf unit 150, the audio unit 160 and the touch screen 170 are electrically connected to each other directly or indirectly, so as to realize data transmission or interaction. These components may typically be connected to each other by one or more communication buses or signal lines, for example. In this embodiment, the http caching apparatus 400 includes at least one software functional module, which may be stored in the memory 110 in a form of software or firmware (firmware) or solidified in an Operating System (OS) of the user terminal 100. The processor 130 is configured to execute executable modules stored in the memory 110, such as software functional modules and computer programs included in the http caching device 400.
The Memory 110 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (Read Only Memory,
ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), electrically Erasable Programmable Read-Only Memory (EEPROM), and the like. The memory 110 may be used to store software programs and modules, such as the http caching method in embodiments of the present invention, and the processor 130 is used to execute the programs after receiving the execution instructions. Access to the memory 110 by the processor 130 and possibly other components may be under the control of the memory controller 120.
The processor 130 may be an integrated circuit chip having signal processing capabilities. The Processor 130 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP)), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The peripheral interface 140 couples various input/output devices to the processor 130 and the memory 110. In some embodiments, peripheral interface 140, processor 130, and memory controller 120 may be implemented in a single chip. In other examples, they may be implemented separately from separate chips.
The rf unit 150 is configured to receive and transmit electromagnetic waves, and achieve interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices.
The audio unit 160 is used to provide an audio interface to a user, and may include one or more microphones, one or more speakers, and audio circuitry.
The touch screen 170 provides an interactive interface (e.g., a user operation interface) between the user terminal 100 and the user at the same time. In the present embodiment, the touch screen 170 supports single-point and multi-point touch operations, and may be a capacitive touch screen or a resistive touch screen supporting single-point and multi-point touch operations. Supporting single-point and multi-point touch operations means that the touch display can sense touch operations generated from one or more locations on the touch display, and the sensed touch operations are sent to the processor 130 for calculation and processing.
It is to be understood that the structure shown in fig. 2 is merely illustrative, and the user terminal 100 may also include more or fewer components than shown in fig. 2, or have a different configuration than shown in fig. 2. The components shown in fig. 2 may be implemented in hardware, software, or a combination thereof.
First embodiment
Fig. 3 is a block diagram of an http caching apparatus 400 according to a first embodiment of the present invention. The http caching apparatus 400 operates in a browser, corresponds to the server 200, and provides a service for a user, and includes a page parsing module 410, a web page detection module 420, a caching policy determination module 430, and a web page display module 440.
The page parsing module 410 is configured to obtain data of a webpage for page parsing to generate a DOM tree.
For example, after a user opens a browser, the browser accesses a specific webpage according to a webpage address input by the user, acquires data of the webpage, performs page parsing, and gradually generates a DOM tree.
The web page detection module 420 is configured to determine a page structure of the web page according to the data of the DOM tree.
In this embodiment, the page structure of the web page may be classified as follows: a first level page, a second level page, and a third level page. It is understood that the primary page is usually the site home page, which is the main entrance of the site contents, the home page of the integrated portal site (e.g. UC, phoenix, panning, etc.) is the aggregate page of various information/channel pages, and the primary page is the page with the highest access frequency, for example, the user may enter the site home page several times after opening the browser to find the information of interest. The secondary page may be a channel page, a category page, a list page, etc., for example, the channel page (e.g., entertainment, sports) of the integrated portal site aggregates various information under this channel, the plate page of the forum site presents a text link (or a graphic link) of a page where a specific post is located in a list manner, the secondary page is usually a page with the second highest access frequency, but for some users, the browsing frequency of the secondary page may be higher than that of the primary page. The third-level page is a page presenting subject content, for example, a specific news page and a page of a specific post of a forum site, and the third-level page is a page with low access frequency, for example, after a user browses a certain news through UC, the user may not access the news again.
In this embodiment, whether the web page is a third-level page may be determined according to the following policy: judging whether the webpage is a website homepage (for example, the webpage can be judged according to webpage address URL information, but not limited to the webpage address URL information), detecting whether headline tags such as h1/h2/h3/h4/h5/h6 exist in DOM tree data meeting the requirement of homescreen display (one of the headline tags is met), and marking the webpage as a three-level page when the webpage is not the website homepage and the headline tags exist in the DOM tree data.
The caching strategy determining module 430 is configured to determine an http caching strategy of the external image resource according to the characteristics of the external image resource loaded through the network and the page structure of the webpage where the external image resource is located.
It should be noted that the picture resources of the external connection refer to picture resources that are independent of the web page resource address and are referred to by img tags or background-image attributes, in this embodiment, an http cache policy needs to be set for the picture resources of the external connection loaded through the network, and an http cache policy does not need to be determined for the picture resources of the external connection that are already locally stored. In this embodiment, the characteristics of the externally connected picture resources loaded through the network are analyzed one by one, and whether to perform http caching on the externally connected picture resources is determined according to the characteristics of the externally connected picture resources and the page structure of the webpage where the externally connected picture resources are located.
Specifically, the caching policy determining module 430 is configured to not perform http caching on the external image resource when a page structure of a webpage where the external image resource is located is a third-level page and the external image resource declared by an img tag is a large image.
For a certain third-level page, the user may not access the page again after accessing the page once, and the external picture resources in the page are also not used again, so that http caching of the external picture resources in the third-level page is not needed locally, and unnecessary capacity consumption (namely triggering of elimination scenes) can be reduced. For example, a news item (three-level page) with eleven # china news, which is linked with three news pictures, will only be browsed once for most users, and accordingly, these three news pictures will also be browsed once, and if these news pictures are http-cached, it is practically unnecessary.
The caching strategy determining module 430 is further configured to perform http caching on the external picture resource when the external picture resource is a background picture.
For example, most sites use small pictures as background pictures (e.g., icon icons) of function buttons or background pictures of layout layouts of pages, and there are such background pictures in the first-level, second-level and third-level pages, and when http caching is performed on these background pictures, the caching validity period is set to be permanently effective, so as to reduce the probability of invalidation due to expiration, reduce network loading, thereby ensuring that the function buttons of the web pages can be displayed in time, and bringing users with good experience of fast web page loading.
The caching strategy determining module 430 is further configured to perform or not perform http caching on the external image resource according to caching information of an http response header of the external image resource when a page structure of a web page where the external image resource is located is a third-level page and the external image resource declared by an img tag is not a large image, or the page structure of the web page where the external image resource is located is not a third-level page.
In this embodiment, for the external image resources under two situations that the page structure of the web page where the external image resources are located is a third-level page and the external image resources declared by the img tag are not large images, or the page structure of the web page where the external image resources are located is not a third-level page, whether http caching is performed or not is judged according to the cache information of the http response header of the external image resources, and if http caching is to be performed on the external image resources, a corresponding caching validity period is calculated.
It should be noted that, the determination of the large graph for the external picture resources in the three-level page may be based on the following rules: when the display position of the external picture resource stated by the img label meets a preset condition and the width is larger than or equal to a preset value, judging that the external picture resource is a big picture, otherwise, judging that the external picture resource is not the big picture. The preset condition may be that the external picture is displayed exclusively in one line, and the preset value may be 90% of the screen width, that is, the width of the external picture resource after the style calculation is greater than or equal to 90% of the screen width.
The web page display module 440 is configured to render the generated DOM tree to display web page content.
In this embodiment, after the feature analysis of the external picture resource loaded through the network is completed, the generated DOM tree is rendered, and the web page content starts to be displayed for the user to browse.
Second embodiment
Fig. 4 is a flowchart illustrating an http caching method according to a second embodiment of the present invention. It should be noted that the http caching method according to the present invention is not limited by the specific sequence shown in fig. 4 and described below, the basic principle and the generated technical effect are the same as those of the first embodiment, and for the sake of brief description, the corresponding contents in the first embodiment may be referred to for the parts not mentioned in this embodiment. It should be understood that, in other embodiments, the order of some steps in the http caching method according to the present invention may be interchanged according to actual needs, or some steps in the http caching method may be omitted or deleted. The specific flow shown in fig. 4 will be described in detail below.
Step S101, acquiring data of the webpage, and performing page parsing to generate a DOM tree.
For example, after a user opens a browser, the browser accesses a specific webpage according to a webpage address input by the user, acquires data of the webpage, performs page parsing, and gradually generates a DOM tree.
It is understood that this step S101 may be performed by the page resolution module 410 described above.
And S102, determining the page structure of the webpage according to the data of the DOM tree.
In this embodiment, whether the web page is a third-level page may be determined according to the following policy: judging whether the webpage is a website homepage (for example, the webpage can be judged according to webpage address URL information, but not limited to the webpage address URL information), detecting whether headline tags such as h1/h2/h3/h4/h5/h6 exist in DOM tree data meeting the requirement of homescreen display (one of the headline tags is met), and marking the webpage as a three-level page when the webpage is not the website homepage and the headline tags exist in the DOM tree data.
It is understood that the step S102 can be performed by the web page detection module 420.
Step S103, determining an http cache strategy of the external picture resource according to the characteristics of the external picture resource loaded through the network and the page structure of the webpage where the external picture resource is located.
In this embodiment, the characteristics of the externally connected picture resources loaded by the network are analyzed one by one, and whether to perform http caching on the externally connected picture resources is determined according to the characteristics of the externally connected picture resources and the page structure of the web page where the externally connected picture resources are located. The http caching strategy of the external picture resource mainly comprises the following steps:
the first case: and when the page structure of the webpage where the external picture resources are located is a three-level page and the external picture resources declared by the img tags are large pictures, the http cache of the external picture resources is not carried out.
For a certain third-level page, the user may not access the page again after accessing the page once, and the external picture resources in the page are also not used again, so that http caching of the external picture resources in the third-level page is not needed locally, and unnecessary capacity consumption (namely triggering of elimination scenes) can be reduced. For example, a news item (three-level page) with eleven # china news, which is linked with three news pictures, will only be browsed once for most users, and accordingly, these three news pictures will also be browsed once, and if these news pictures are http-cached, it is practically unnecessary.
The second case: and when the external picture resource is a background picture, carrying out http caching on the external picture resource.
For example, most sites use small pictures as background pictures (e.g., icon icons) of function buttons or background pictures of layout layouts of pages, and there are such background pictures in the first-level, second-level and third-level pages, and when http caching is performed on these background pictures, the caching validity period is set to be permanently effective, so as to reduce the probability of invalidation due to expiration, reduce network loading, thereby ensuring that the function buttons of the web pages can be displayed in time, and bringing users with good experience of fast web page loading.
The third situation: and when the page structure of the webpage where the external picture resources are located is a three-level page and the external picture resources declared by the img tags are not big images, or the page structure of the webpage where the external picture resources are located is not a three-level page, carrying out or not carrying out http caching on the external picture resources according to the caching information of the http response header of the external picture resources.
In this embodiment, for the external image resources under two situations that the page structure of the web page where the external image resources are located is a third-level page and the external image resources declared by the img tag are not large images, or the page structure of the web page where the external image resources are located is not a third-level page, whether http caching is performed or not is judged according to the cache information of the http response header of the external image resources, and if http caching is to be performed on the external image resources, a corresponding caching validity period is calculated.
It should be noted that, the determination of the large graph for the external picture resources in the three-level page may be based on the following rules: when the display position of the external picture resource stated by the img label meets a preset condition and the width is larger than or equal to a preset value, judging that the external picture resource is a big picture, otherwise, judging that the external picture resource is not the big picture. The preset condition may be that the external picture is displayed exclusively in one line, and the preset value may be 90% of the screen width, that is, the width of the external picture resource after the style calculation is greater than or equal to 90% of the screen width.
It is understood that this step S103 may be performed by the above-described cache policy determination module 430.
And step S104, rendering the generated DOM tree to display the webpage content.
In this embodiment, after the feature analysis of the external picture resource loaded through the network is completed, the generated DOM tree is rendered, and the web page content starts to be displayed for the user to browse.
It is understood that the step S104 can be executed by the web page display module 440 described above.
In summary, in the http caching method, the http caching device, and the user terminal provided in the embodiments of the present invention, a mobile browser obtains web page data, performs page parsing to gradually generate a DOM tree, determines a page structure of the web page according to the data of the DOM tree, marks a third-level page if the web page is the third-level page, performs feature analysis on an external image resource loaded through a network, and determines an http caching policy of the external image resource according to the feature of the external image resource and the page structure of the web page where the external image resource is located. When the page structure of the webpage where the external picture resources are located is a three-level page and the external picture resources declared by the img tags are large pictures, http caching is not carried out on the external picture resources; when the page structure of the webpage where the external picture resources are located is a three-level page and the external picture resources declared by the img tags are not big images, or the page structure of the webpage where the external picture resources are located is not a three-level page, http caching is carried out or not carried out on the external picture resources according to the caching information of the http response header of the external picture resources, and if the http caching is carried out on the external picture resources, the corresponding caching validity period is calculated; when the external picture resources are background pictures, http caching is carried out on the external picture resources, and when the background pictures are subjected to http caching, the caching validity period is set to be permanent and effective, the probability of invalidation caused by expiration is reduced, and network loading is reduced. When the display position of the external image resource declared by the img label under the three-level page meets a preset condition and the width of the external image resource is larger than or equal to a preset value, judging that the external image resource is a big image, and otherwise, judging that the external image resource is not the big image. The http caching method and the device provided by the invention are combined with the browsing behavior and habit of the user, so that unnecessary capacity consumption of the http cache can be reduced, the webpage loading speed can be effectively increased, and the browsing experience of the user is better.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.

Claims (13)

1. An http caching method, characterized in that the http caching method comprises:
acquiring data of a webpage, and performing page analysis to generate a DOM tree;
determining the page structure of the webpage according to the data of the DOM tree;
determining an http cache strategy of the external picture resource according to the characteristics of the external picture resource loaded through a network and a page structure of a webpage where the external picture resource is located;
the step of determining the http caching strategy of the external picture resource according to the characteristics of the external picture resource loaded through the network and the page structure of the webpage where the external picture resource is located comprises the following steps: and when the page structure of the webpage where the external picture resources are located is a three-level page and the external picture resources declared by the img tags are large pictures, the http cache of the external picture resources is not carried out.
2. The http caching method according to claim 1, wherein the step of determining the http caching policy for the outbound picture resource based on the characteristics of the outbound picture resource loaded via the network and the page structure of the web page where the outbound picture resource is located further comprises:
and when the page structure of the webpage where the external picture resources are located is a three-level page and the external picture resources declared by the img tags are not big images, or the page structure of the webpage where the external picture resources are located is not a three-level page, carrying out or not carrying out http caching on the external picture resources according to the caching information of the http response header of the external picture resources.
3. The http caching method according to claim 1 or 2, wherein when the display position of the external picture resource declared by the img tag satisfies a preset condition and the width is greater than or equal to a preset value, the external picture resource is determined to be a large picture, otherwise, the external picture resource is determined not to be a large picture.
4. The http caching method according to claim 1, wherein the step of determining the http caching policy for the outbound picture resource based on the characteristics of the outbound picture resource loaded via the network and the page structure of the web page where the outbound picture resource is located further comprises:
and when the external picture resource is a background picture, carrying out http caching on the external picture resource.
5. The http caching method of claim 4, wherein a caching lifetime is set to be permanently valid when http caching is performed on the background map.
6. The http caching method of claim 1, further comprising:
and rendering the generated DOM tree to display the webpage content.
7. An http caching apparatus, characterized in that the http caching apparatus comprises:
the page analysis module is used for acquiring data of the webpage and carrying out page analysis to generate a DOM tree;
the webpage detection module is used for determining the page structure of the webpage according to the data of the DOM tree;
the cache strategy determining module is used for determining an http cache strategy of the external picture resource according to the characteristics of the external picture resource loaded through a network and the page structure of the webpage where the external picture resource is located;
the caching strategy determining module is used for not caching the external picture resources in an http manner when the page structure of the webpage where the external picture resources are located is a three-level page and the external picture resources declared by the img tags are large pictures.
8. The http caching apparatus of claim 7, wherein the caching policy determining module is further configured to perform or not perform http caching on the external picture resource according to caching information of an http response header of the external picture resource, when a page structure of a webpage where the external picture resource is located is a third-level page and the external picture resource declared by an img tag is not a large image, or the page structure of the webpage where the external picture resource is located is not a third-level page.
9. The http caching apparatus according to claim 7 or 8, wherein when the display position of the outerjoin picture resource declared by the img tag satisfies a preset condition and the width is greater than or equal to a preset value, the outerjoin picture resource is determined to be a large picture, otherwise, the outerjoin picture resource is determined not to be a large picture.
10. The http caching apparatus of claim 7, wherein the caching policy determining module is further configured to perform http caching on the external picture resource when the external picture resource is a background picture.
11. The http caching apparatus according to claim 10, wherein a caching period is set to be permanently valid when http caching is performed on the background map.
12. The http caching apparatus of claim 7, wherein the http caching apparatus further comprises:
and the webpage display module is used for rendering the generated DOM tree to display webpage content.
13. A user terminal, characterized in that the user terminal comprises:
a memory;
a processor; and
an http caching apparatus stored in the memory and including one or more software functional modules executed by the processor, the http caching apparatus comprising:
the page analysis module is used for acquiring data of the webpage and carrying out page analysis to generate a DOM tree;
the webpage detection module is used for determining the page structure of the webpage according to the data of the DOM tree;
the cache strategy determining module is used for determining an http cache strategy of the external picture resource according to the characteristics of the external picture resource loaded through a network and the page structure of the webpage where the external picture resource is located;
the step of determining the http caching strategy of the external picture resource according to the characteristics of the external picture resource loaded through the network and the page structure of the webpage where the external picture resource is located comprises the following steps: and when the page structure of the webpage where the external picture resources are located is a three-level page and the external picture resources declared by the img tags are large pictures, the http cache of the external picture resources is not carried out.
CN201710133829.2A 2017-03-08 2017-03-08 HTTP caching method and device and user terminal Active CN108280105B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710133829.2A CN108280105B (en) 2017-03-08 2017-03-08 HTTP caching method and device and user terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710133829.2A CN108280105B (en) 2017-03-08 2017-03-08 HTTP caching method and device and user terminal

Publications (2)

Publication Number Publication Date
CN108280105A CN108280105A (en) 2018-07-13
CN108280105B true CN108280105B (en) 2020-12-04

Family

ID=62801142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710133829.2A Active CN108280105B (en) 2017-03-08 2017-03-08 HTTP caching method and device and user terminal

Country Status (1)

Country Link
CN (1) CN108280105B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101807193B (en) * 2009-12-31 2015-07-22 优视科技有限公司 Browsing method used for mobile communication equipment terminal
US9569557B2 (en) * 2011-12-29 2017-02-14 Chegg, Inc. Cache management in HTML eReading application
CN103514179B (en) * 2012-06-21 2018-06-15 腾讯科技(深圳)有限公司 Web browser switches the method and web browser of history web pages
CN104035921B (en) * 2013-03-04 2017-08-29 联想(北京)有限公司 A kind of information processing method and electronic equipment
US9697189B2 (en) * 2013-11-15 2017-07-04 Instart Logic, Inc. Partial website optimization for a web publisher

Also Published As

Publication number Publication date
CN108280105A (en) 2018-07-13

Similar Documents

Publication Publication Date Title
US8307279B1 (en) Smooth zooming in web applications
CN105210051B (en) Estimate the method and system of the visibility of content item
US10109079B2 (en) Method and apparatus for processing tab in graphical interface
US20120066379A1 (en) Method and system for notifying network resource updates
CN106911693B (en) Method and device for detecting hijacking of webpage content and terminal equipment
WO2015154666A1 (en) Method for displaying webpage fragment on desktop and system for capturing webpage fragment to desktop for display
CN110598149A (en) Webpage access method, device and storage medium
CN104182408A (en) Webpage off-line access method and webpage off-line access device
WO2018141300A1 (en) Webpage pre-reading method, webpage access method, device, and electronic device
CN107124477A (en) Processing method, terminal and the server of web site contents
CN105138698A (en) Dynamic layout method and device for webpages
CN106936727A (en) A kind of Webpage display process and device
TWI519980B (en) Method and device for displaying web page and computer-readable storage medium
CN106899689B (en) Information pre-issuing method and server
CN109302493B (en) User information sharing method and device, electronic equipment and storage medium
US10095791B2 (en) Information search method and apparatus
CN111783010B (en) Webpage blank page monitoring method, device, terminal and storage medium
US20170277422A1 (en) Method, application, browser, and electronic device for providing webpage content
CN108280105B (en) HTTP caching method and device and user terminal
CN108829828B (en) Webpage display method and device, electronic equipment and readable storage medium
CN111367606A (en) Application page display method, device, terminal and medium
CN107770630B (en) Television navigation page display method and device, navigation system and readable storage medium
CN105956202A (en) Web page display method and web page display apparatus in browser as well as terminal
CN108572980B (en) Webpage split-screen display method and device
CN107656935B (en) Webpage display method and device

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
TA01 Transfer of patent application right

Effective date of registration: 20200622

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510627 14th floor, Tower B, Guangdian Pingyun Plaza, 163 xipingyun Road, Huangpu Avenue, Tianhe District, Guangzhou City, Guangdong Province

Applicant before: GUANGZHOU UCWEB COMPUTER TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant