CN107861966B - Cache detection method, equipment and computer readable storage medium - Google Patents

Cache detection method, equipment and computer readable storage medium Download PDF

Info

Publication number
CN107861966B
CN107861966B CN201710741429.XA CN201710741429A CN107861966B CN 107861966 B CN107861966 B CN 107861966B CN 201710741429 A CN201710741429 A CN 201710741429A CN 107861966 B CN107861966 B CN 107861966B
Authority
CN
China
Prior art keywords
website
webpage
channel identification
browser
type information
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
CN201710741429.XA
Other languages
Chinese (zh)
Other versions
CN107861966A (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.)
Ping An Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN201710741429.XA priority Critical patent/CN107861966B/en
Publication of CN107861966A publication Critical patent/CN107861966A/en
Application granted granted Critical
Publication of CN107861966B publication Critical patent/CN107861966B/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 invention discloses a cache detection method, which comprises the following steps: when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address; acquiring webpage type information cached by a browser, and comparing the acquired webpage type information with webpage type information in a first website address; and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal. The invention also discloses a cache detection device and a computer readable storage medium. The invention can realize the automatic detection of the website webpage caching function, thereby improving the efficiency and the accuracy of the detection.

Description

Cache detection method, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a cache detection method, a cache detection device, and a computer-readable storage medium.
Background
At present, many commercial websites have a web page information caching function, namely, a web page information caching function, that is, when a user accesses a web page of a website using a browser, a caching program of the website controls the browser to cache relevant field information in the website of the website, and the cached field information and personal information input by the user on the web page are sent together and stored to a business system database of the website, so that merchants can know the access behavior of the user based on the web page of the website.
Due to the loophole of the website cache program or incomplete loading of the website cache program, the webpage information caching function of the website may be abnormal. In the prior art, in order to test whether the web page information caching function of a website is normal, a manual test means is generally adopted, that is, website maintenance personnel periodically and manually access each web page of the website one by one and check browser caching, that is, whether relevant field information cached in a browser cookie is correct or not is judged, and because the web pages of the general website are numerous, a manual detection mode is undoubtedly time-consuming and labor-consuming, and errors are easy to occur.
Disclosure of Invention
The invention mainly aims to provide a cache detection method, equipment and a computer readable storage medium, aiming at realizing the automatic detection of the website webpage cache function, thereby improving the efficiency and the accuracy of the detection.
In order to achieve the above object, the present invention provides a cache detection method, which includes the following steps:
when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website;
and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal.
Optionally, the web page type information includes a web page type identifier and cache expiration time of the web page type identifier, and before the step of determining that the cache function of the web page of the website corresponding to the first website address is normal, the method further includes:
detecting whether the webpage type identifier exists in a cache of the browser or not after the cache expiration time of the webpage type identifier;
if the webpage type identification does not exist in the cache of the browser, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Optionally, before the step of determining that the caching function of the website webpage corresponding to the first website address is normal, the method further includes:
adding a preset channel identification parameter in the first website to obtain a second website, wherein the channel identification parameter is used for identifying a delivery channel of the second website;
controlling the browser to access the second website address so that the browser caches a channel identification parameter in the second website address;
acquiring the channel identification parameter cached by the browser, and comparing the acquired channel identification parameter with a channel identification parameter in the website of the second website;
if the obtained channel identification parameter is the same as the channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Optionally, before the step of determining that the caching function of the website webpage corresponding to the first website address is normal, the method further includes:
modifying the channel identification parameter in the website of the second website, and controlling the browser to access the modified website of the second website so that the browser caches the modified channel identification parameter;
acquiring the modified channel identification parameters cached by the browser, and comparing the acquired modified channel identification parameters with the modified channel identification parameters in the second website address;
if the obtained modified channel identification parameter is the same as the modified channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Optionally, the modifying comprises increasing or decreasing the channel identification parameter, or changing a parameter value of the channel identification parameter.
In addition, to achieve the above object, the present invention further provides a cache detection device, including: a memory, a processor, and a cache detection program stored on the memory and executable on the processor, the cache detection program when executed by the processor implementing the steps of:
when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website;
and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal.
Optionally, the webpage type information includes a webpage type identifier and a cache expiration time of the webpage type identifier, and when executed by the processor, the cache detection program further implements the following steps:
detecting whether the webpage type identifier exists in a cache of the browser or not after the cache expiration time of the webpage type identifier;
if the webpage type identification does not exist in the cache of the browser, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Optionally, when executed by the processor, the cache detection program further implements the following steps:
adding a preset channel identification parameter in the first website to obtain a second website, wherein the channel identification parameter is used for identifying a delivery channel of the second website;
controlling the browser to access the second website address so that the browser caches a channel identification parameter in the second website address;
acquiring the channel identification parameter cached by the browser, and comparing the acquired channel identification parameter with a channel identification parameter in the website of the second website;
if the obtained channel identification parameter is the same as the channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Optionally, when executed by the processor, the cache detection program further implements the following steps:
modifying the channel identification parameter in the website of the second website, and controlling the browser to access the modified website of the second website so that the browser caches the modified channel identification parameter;
acquiring the modified channel identification parameters cached by the browser, and comparing the acquired modified channel identification parameters with the modified channel identification parameters in the second website address;
if the obtained modified channel identification parameter is the same as the modified channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium having a cache detection program stored thereon, where the cache detection program, when executed by a processor, implements the following steps:
when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website;
and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal.
When a cache detection instruction is received, a preset browser is controlled to access a preset first website address containing webpage type information, so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address; acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website; and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal. According to the method and the device, the browser caches the webpage type information in the website by simulating the operation of accessing the website webpage by the user, and then compares the webpage type information cached by the browser with the real webpage type information to judge whether the caching function of the website webpage is normal or not, so that the automatic detection of the website webpage caching function is realized, and the detection efficiency and accuracy are improved.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a cache detection method according to a first embodiment of the present invention;
fig. 3 is a flowchart illustrating a cache detection method according to a third embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address; acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website; and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal.
In the prior art, in order to test whether the web page information caching function of a website is normal, a manual test means is generally adopted, that is, website maintenance personnel periodically and manually access each web page of the website one by one and check browser caching, that is, whether relevant field information cached in a browser cookie is correct or not is judged, and because the web pages of the general website are numerous, a manual detection mode is undoubtedly time-consuming and labor-consuming, and errors are easy to occur.
According to the method and the device, the browser caches the webpage type information in the website by simulating the operation of accessing the website webpage by the user, and then compares the webpage type information cached by the browser with the real webpage type information to judge whether the caching function of the website webpage is normal or not, so that the automatic detection of the website webpage caching function is realized, and the detection efficiency and accuracy are improved.
The invention provides a method.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The device of the embodiment of the invention can be a PC, and can also be a mobile terminal device with a display function, such as a smart phone, a tablet computer, a portable computer and the like.
As shown in fig. 1, the apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the device architecture shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a cache detection program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to call the cache detection program stored in the memory 1005 and perform the following operations:
when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website;
and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal.
Further, the webpage type information includes a webpage type identifier and a cache expiration time of the webpage type identifier, and the processor 1001 may call a cache detection program stored in the memory 1005, and further perform the following operations:
detecting whether the webpage type identifier exists in a cache of the browser or not after the cache expiration time of the webpage type identifier;
if the webpage type identification does not exist in the cache of the browser, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Further, the processor 1001 may call a cache detection program stored in the memory 1005, and further perform the following operations:
adding a preset channel identification parameter in the first website to obtain a second website, wherein the channel identification parameter is used for identifying a delivery channel of the second website;
controlling the browser to access the second website address so that the browser caches a channel identification parameter in the second website address;
acquiring the channel identification parameter cached by the browser, and comparing the acquired channel identification parameter with a channel identification parameter in the website of the second website;
if the obtained channel identification parameter is the same as the channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Further, the processor 1001 may call a cache detection program stored in the memory 1005, and further perform the following operations:
modifying the channel identification parameter in the website of the second website, and controlling the browser to access the modified website of the second website so that the browser caches the modified channel identification parameter;
acquiring the modified channel identification parameters cached by the browser, and comparing the acquired modified channel identification parameters with the modified channel identification parameters in the second website address;
if the obtained modified channel identification parameter is the same as the modified channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Further, the modifying includes increasing or decreasing the channel identification parameter, or changing a parameter value of the channel identification parameter.
Based on the above hardware structure, the embodiment of the cache detection method of the present invention is provided.
Referring to fig. 2, fig. 2 is a schematic flowchart of a cache detection method according to a first embodiment of the present invention, where the cache detection method includes:
step S10, when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information, so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
the cache detection method of the embodiment can be implemented by a cache detection application or a cache detection program installed on a cache detection device, the cache detection device can be a PC, or a mobile terminal device with a display function such as a smart phone, a tablet computer, a portable computer, etc., and the cache detection device is also installed with a browser application for accessing a website webpage.
The application scenario of this embodiment may be: the user opens the cache detection application and presets the frequency or time point of cache detection for the website webpage to be detected, for example, the cache detection is performed every 1 week, or the cache detection is performed every zero hour, and then, the cache detection program automatically detects whether the cache function of the website webpage to be detected is normal according to the preset frequency or time point. Certainly, the cache detection program may also directly receive a cache detection instruction triggered by a user, or receive a cache detection instruction sent by another application program, so as to detect the cache function of the website webpage to be detected, and the cache detection program may be flexibly set in specific implementation.
When the cache detection program receives the cache detection instruction, a preset browser can be opened according to the cache detection instruction, and the browser is controlled to automatically access a preset first website address containing the webpage type information, so that the browser caches the webpage type information in the first website address. The type of the preset browser is not limited, and for example, the preset browser may be an IE browser, a Baidu browser, a google browser, or another customized browser with a web page information caching function; the first website address contains webpage type information, the webpage type information is represented as an identification field in the website address and is used for identifying the webpage type corresponding to the first website address, wherein the division type of the webpage type can be flexibly set, for example, the webpage type can be divided into a hundred-degree webpage, a google webpage, a dog searching webpage and the like according to different access media, the webpage type can be divided into a mobile phone version webpage, a computer version webpage and the like according to different access devices, and in addition, the identification field corresponding to the divided webpage type can also be flexibly set. The following examples are given.
Suppose a predetermined first website address containing webpage type information is https:// www.ph.com.cn? Wt. mc _ id 111& wt. mc _ hd pidx, where the identification field wt. mc _ id 111& wt. mc _ hd pidx identifies the web page type information, and it is preset that wt. mc _ id 111 identifies the hundredth degree web page, wt. mc _ hd pidx identifies the handset version web page, then wt. mc _ id 111& wt. mc _ hd pidx identifies the access media of the first website address as hundredth degree, and the first website address corresponds to the handset version web page.
When the browser accesses the first website address, two pieces of web page type information, wt.
Step S20, acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the first website address;
due to the fact that the website cache program is a bug or the website cache program is loaded incompletely, the webpage information caching function of the website may be abnormal, and finally the webpage type information cached in the browser is inconsistent with the webpage type information in the real website address, so that after the browser caches the webpage type in the website address, the cache detection program obtains the webpage type information cached by the browser, and compares the obtained webpage type information with the webpage type information in the first website address to judge whether the two are the same.
If the acquired webpage type information is the same as the webpage type information in the first website, executing:
and step S30, judging that the caching function of the website webpage corresponding to the first website address is normal.
And if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal. Specifically, let the first website address be https:// www.ph.com.cn? For example, if the web page type information cached in the browser acquired by the cache detection device is wt.mc _ id is 111, wt.mc _ hd is pidx, and the web page type information in the first website address is also wt.mc _ id is 111, wt.mc _ hd is pidx, at this time, it is determined that the cache function of the website web page corresponding to the first website address is normal.
If the obtained web page type information is different from the web page type information in the first website address, for example, the obtained web page type information cached in the browser is wt.mc _ id 222, wt.mc _ hd pidx, and the web page type information in the first website address is wt.mc _ id 111, wt.mc _ hd pidx, it may be determined that the cache function of the website web page corresponding to the first website address is abnormal.
It can be understood that all web pages in the website are used as the web pages of the website to be detected, and the cache function of the web pages of the website to be detected is detected one by one according to the above steps, so that the cache detection result of the whole website can be obtained, and if the cache function of any web page of the website is abnormal, the cache function of the website can be determined to be abnormal.
In this embodiment, when a cache detection instruction is received, a preset browser is controlled to access a preset first website address containing webpage type information, so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address; acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website; and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal. In the embodiment, the operation of accessing the website webpage by the user is simulated, so that the browser caches the webpage type information in the website, and then compares the webpage type information cached by the browser with the real webpage type information to judge whether the caching function of the website webpage is normal, thereby realizing the automatic detection of the website webpage caching function and improving the detection efficiency and accuracy.
Further, based on the first embodiment of the cache detection method of the present invention, a second embodiment of the cache detection method of the present invention is provided.
In this embodiment, the webpage type information includes a webpage type identifier and an expiration time of the webpage type identifier, which is called cache expiration time, that is, an expiration time point at which the webpage type identifier is stored in the browser cache, and after the cache expiration time, the webpage type identifier is not stored in the browser cache any more. Based on the above embodiment shown in fig. 2, before step S30, the method may further include:
step S40, detecting whether the webpage type identification exists in the cache of the browser after the cache expiration time of the webpage type identification;
in this step, when the obtained webpage type information cached by the browser is the same as the webpage type information in the website of the first website, the cache detection program continues to detect the obtained webpage type information cached by the browser. Specifically, let the first website address be https:// www.ph.com.cn? For example, wt.mc _ id 111&19:15:07, where wt.mc _ id is a web page type identifier, and 19:15:07 indicates that the expiration time of this web page type identifier is 19 hours, 15 minutes and 07 seconds, the cache detection program detects whether wt.mc _ id 111 continues to exist in the cache of the browser after the current system time reaches 19 hours, 15 minutes and 07 seconds.
If the web page type identifier does not exist in the cache of the browser any more after the cache expiration time, step S30 is executed: and judging that the caching function of the website webpage corresponding to the first website address is normal. Otherwise, judging that the cache function of the website webpage corresponding to the first website address is abnormal.
According to the embodiment, the detection range is expanded by detecting the cache failure time of the webpage type identifier, and the accuracy of webpage cache function detection is further improved.
Further, based on the first or second embodiment of the cache detection method of the present invention, a third embodiment of the cache detection method of the present invention is proposed. Referring to fig. 3, fig. 3 is a flowchart illustrating a cache detection method according to a third embodiment of the present invention. Based on the above-mentioned embodiment shown in fig. 2, before the step S30, the method may further include:
step S50, adding a preset channel identification parameter in the first website to obtain a second website, wherein the channel identification parameter is used for identifying a delivery channel of the second website;
in this step, before the step of determining that the cache function of the website page corresponding to the first website address is normal, the cache detection program may further add a preset channel identification parameter to the first website address to obtain a second website address, where the channel identification parameter is used to identify a delivery channel of the second website address.
The channel id parameters commonly used at present include utm parameter and hm parameter, and utm parameter is taken as an example for description. The utm parameters mainly include the following types:
1. utm _ source (delivered media), such as utm _ source zhihhu, indicating that the delivered media channel is known; 2. utm _ medium, such as utm _ medium ═ article, which indicates that the medium delivered is an article; 3. utm _ campaigns (drop units), such as utm _ campaigns ═ product, indicating that the article is in the product introduction line; 4. utm _ content, such as utm _ content ═ textlink, indicating that the article content is primarily textual links, 5, utm _ term, such as utm _ content ═ shoes, indicating that the article is primarily descriptive of the article of footwear.
The first web site address is https:// www.ph.com.cn? Mc _ id 111, a preset channel identification parameter utm _ source ═ a, utm _ medium ═ b, utm _ campaign ═ c, utm _ content ═ d, utm _ term? Wt. mc _ id ═ 111& utm _ source ═ a & utm _ medium ═ b & utm _ campaign ═ c & utm _ content ═ d & utm _ term ═ e.
Step S60, controlling the browser to access the second website address, so that the browser caches the channel identification parameter in the second website address;
in this step, the cache detection program controls the browser to access the second website address, so that the browser caches the channel identification parameters in the second website address, that is, the channel identification parameters of utm _ source, utm _ medium, utm _ campaign, utm _ content, and utm _ term, etc. are cached.
Step S70, acquiring the channel identification parameter cached by the browser, and comparing the acquired channel identification parameter with the channel identification parameter in the second website address;
if the obtained channel identification parameter is the same as the channel identification parameter in the second website address, executing step S30: and judging that the caching function of the website webpage corresponding to the first website address is normal.
In the step, the cache detection program acquires the channel identification parameter cached by the browser, and compares the acquired channel identification parameter with the channel identification parameter in the second website address to judge whether the two are the same. For example, if the obtained channel identifier parameter of the browser cache is consistent with the channel identifier parameter of the second website address, which are utm _ source ═ a, utm _ medium ═ b, utm _ cache ═ c, utm _ content ═ d, and utm _ term ═ e, it is determined that the cache function of the website page corresponding to the first website address is normal at this time, and on the contrary, it is determined that the cache function of the website page corresponding to the first website address is abnormal.
The implementation further expands the detection range and improves the accuracy of webpage cache function detection by adding the detection of the channel identification parameters in the cache.
Further, based on the third embodiment of the cache detection method of the present invention, a fourth embodiment of the cache detection method of the present invention is provided. In this embodiment, step S30 may further include:
step S80, modifying the channel identification parameter in the second website address, and controlling the browser to access the modified second website address, so that the browser caches the modified channel identification parameter;
in this step, before the step of determining that the caching function of the website page corresponding to the first website address is normal, the cache detection program may further modify the channel identification parameter in the second website address, and then control the browser to access the modified second website address, so that the browser caches the modified channel identification parameter. Specifically, the modification includes increasing or decreasing the channel identification parameter, or changing the parameter value of the channel identification parameter, for example, the channel identification parameter in the third embodiment may be modified to utm _ source ═ a, utm _ medium ═ b, utm _ campaign ═ f.
Step S90, acquiring the modified channel identification parameter cached by the browser, and comparing the acquired modified channel identification parameter with the modified channel identification parameter in the second website address;
if the obtained modified channel identification parameter is the same as the modified channel identification parameter in the second website, executing step S30: and judging that the caching function of the website webpage corresponding to the first website address is normal.
In the step, the cache detection program acquires the modified channel identification parameter cached by the browser, and compares the acquired modified channel identification parameter with the modified channel identification parameter in the website of the second website to judge whether the two are the same. For example, if the obtained modified channel identifier parameter is consistent with the modified channel identifier parameter in the second website address, which are utm _ source ═ a, utm _ medium ═ b, and utm _ campaign ═ f, then it is determined that the cache function of the website page corresponding to the first website address is normal, and otherwise, it is determined that the cache function of the website page corresponding to the first website address is abnormal.
In this embodiment, the channel identification parameter in the second website address is modified, so as to access the modified second website address, and whether the channel identification parameter cached in the browser at this time is consistent with the modified channel identification parameter is determined, so that the detection range is further expanded, and the accuracy of the webpage cache function detection is improved.
The invention also provides a cache detection device.
The cache detection device of the present invention comprises: a memory, a processor, and a cache detection program stored on the memory and executable on the processor, the cache detection program when executed by the processor implementing the steps of:
when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website;
and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal.
Further, the webpage type information includes a webpage type identifier and a cache expiration time of the webpage type identifier, and the cache detection program, when executed by the processor, further implements the following steps:
detecting whether the webpage type identifier exists in a cache of the browser or not after the cache expiration time of the webpage type identifier;
if the webpage type identification does not exist in the cache of the browser, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Further, when executed by the processor, the cache detection program further implements the steps of:
adding a preset channel identification parameter in the first website to obtain a second website, wherein the channel identification parameter is used for identifying a delivery channel of the second website;
controlling the browser to access the second website address so that the browser caches a channel identification parameter in the second website address;
acquiring the channel identification parameter cached by the browser, and comparing the acquired channel identification parameter with a channel identification parameter in the website of the second website;
if the obtained channel identification parameter is the same as the channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
Further, when executed by the processor, the cache detection program further implements the steps of:
modifying the channel identification parameter in the website of the second website, and controlling the browser to access the modified website of the second website so that the browser caches the modified channel identification parameter;
acquiring the modified channel identification parameters cached by the browser, and comparing the acquired modified channel identification parameters with the modified channel identification parameters in the second website address;
if the obtained modified channel identification parameter is the same as the modified channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
The method implemented when the cache detection program running on the processor is executed may refer to the embodiment of the cache detection method of the present invention, and details thereof are not described herein.
The invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention stores a cache detection program, and the cache detection program realizes the following steps when executed by a processor:
when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website;
and if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal.
The method implemented when the cache detection program running on the processor is executed may refer to the embodiment of the cache detection method of the present invention, and details thereof are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system 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 system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention essentially or contributing to the prior art can be embodied in the form of a software product, which is stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server or a network device, etc.) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A cache detection method is characterized by comprising the following steps:
when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website;
if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal;
adding a preset channel identification parameter in the first website to obtain a second website, wherein the channel identification parameter is used for identifying a delivery channel of the second website;
controlling the browser to access the second website address so that the browser caches a channel identification parameter in the second website address;
acquiring the channel identification parameter cached by the browser, and comparing the acquired channel identification parameter with a channel identification parameter in the website of the second website;
if the obtained channel identification parameter is the same as the channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
2. The cache detection method according to claim 1, wherein the web page type information includes a web page type identifier and a cache expiration time of the web page type identifier, and before the step of determining that the cache function of the web page of the website corresponding to the first website address is normal, the method further includes:
detecting whether the webpage type identifier exists in a cache of the browser or not after the cache expiration time of the webpage type identifier;
if the webpage type identification does not exist in the cache of the browser, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
3. The cache detection method according to claim 1, wherein before the step of determining that the cache function of the website page corresponding to the first website address is normal, the method further comprises:
modifying the channel identification parameter in the website of the second website, and controlling the browser to access the modified website of the second website so that the browser caches the modified channel identification parameter;
acquiring the modified channel identification parameters cached by the browser, and comparing the acquired modified channel identification parameters with the modified channel identification parameters in the second website address;
if the obtained modified channel identification parameter is the same as the modified channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
4. The cache detection method of claim 3, wherein the modification comprises increasing or decreasing the channel identification parameter, or changing a parameter value of the channel identification parameter.
5. A cache detection device, characterized in that the cache detection device comprises: a memory, a processor, and a cache detection program stored on the memory and executable on the processor, the cache detection program when executed by the processor implementing the steps of:
when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website;
if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal;
adding a preset channel identification parameter in the first website to obtain a second website, wherein the channel identification parameter is used for identifying a delivery channel of the second website;
controlling the browser to access the second website address so that the browser caches a channel identification parameter in the second website address;
acquiring the channel identification parameter cached by the browser, and comparing the acquired channel identification parameter with a channel identification parameter in the website of the second website;
if the obtained channel identification parameter is the same as the channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
6. The cache detection device of claim 5, wherein the web page type information includes a web page type identifier and a cache expiration time for the web page type identifier, the cache detection program when executed by the processor further implementing the steps of:
detecting whether the webpage type identifier exists in a cache of the browser or not after the cache expiration time of the webpage type identifier;
if the webpage type identification does not exist in the cache of the browser, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
7. The cache detection device of claim 5, wherein the cache detection program when executed by the processor further performs the steps of:
modifying the channel identification parameter in the website of the second website, and controlling the browser to access the modified website of the second website so that the browser caches the modified channel identification parameter;
acquiring the modified channel identification parameters cached by the browser, and comparing the acquired modified channel identification parameters with the modified channel identification parameters in the second website address;
if the obtained modified channel identification parameter is the same as the modified channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
8. A computer-readable storage medium having a cache detection program stored thereon, the cache detection program when executed by a processor implementing the steps of:
when a cache detection instruction is received, controlling a preset browser to access a preset first website address containing webpage type information so that the browser caches the webpage type information in the first website address, wherein the webpage type information is used for identifying a webpage type corresponding to the first website address;
acquiring the webpage type information cached by the browser, and comparing the acquired webpage type information with the webpage type information in the website of the first website;
if the acquired webpage type information is the same as the webpage type information in the first website, judging that the caching function of the website webpage corresponding to the first website is normal;
adding a preset channel identification parameter in the first website to obtain a second website, wherein the channel identification parameter is used for identifying a delivery channel of the second website;
controlling the browser to access the second website address so that the browser caches a channel identification parameter in the second website address;
acquiring the channel identification parameter cached by the browser, and comparing the acquired channel identification parameter with a channel identification parameter in the website of the second website;
if the obtained channel identification parameter is the same as the channel identification parameter in the second website address, executing the following steps: and judging that the caching function of the website webpage corresponding to the first website address is normal.
CN201710741429.XA 2017-08-24 2017-08-24 Cache detection method, equipment and computer readable storage medium Active CN107861966B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710741429.XA CN107861966B (en) 2017-08-24 2017-08-24 Cache detection method, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710741429.XA CN107861966B (en) 2017-08-24 2017-08-24 Cache detection method, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107861966A CN107861966A (en) 2018-03-30
CN107861966B true CN107861966B (en) 2020-08-04

Family

ID=61699207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710741429.XA Active CN107861966B (en) 2017-08-24 2017-08-24 Cache detection method, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107861966B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113762937A (en) * 2020-06-03 2021-12-07 富泰华工业(深圳)有限公司 Advertisement operation system and method, readable storage medium
CN114244581B (en) * 2021-11-29 2024-03-29 西安四叶草信息技术有限公司 Cache poisoning vulnerability detection method and device, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7765196B2 (en) * 2003-06-23 2010-07-27 Dell Products L.P. Method and apparatus for web cache using database triggers
WO2009014659A1 (en) * 2007-07-19 2009-01-29 Ebay Inc. Web page cache status detector
CN104298675B (en) * 2013-07-18 2017-06-16 国际商业机器公司 For the method and apparatus of cache management
CN103455603B (en) * 2013-09-03 2016-08-17 小米科技有限责任公司 Web page contents caching, webpage loading method, device and terminal unit
CN105930528B (en) * 2016-06-03 2020-09-08 腾讯科技(深圳)有限公司 Webpage caching method and server

Also Published As

Publication number Publication date
CN107861966A (en) 2018-03-30

Similar Documents

Publication Publication Date Title
US10528742B2 (en) Method and apparatus for repairing kernel vulnerability
CN104486140A (en) Device and method for detecting hijacking of web page
CN107015801B (en) Webpage display method and application terminal
CN111666497A (en) Application program loading method and device, electronic equipment and readable storage medium
CN111090592A (en) Automatic testing method of buried point, terminal and readable storage medium
CN109471768B (en) Service problem monitoring method and device and electronic equipment
CN111522738A (en) Test method and device of micro-service system, storage medium and electronic equipment
CN109522500B (en) Webpage display method, device, terminal and storage medium
US10498746B2 (en) Cloud based reputation system for browser extensions and toolbars
CN107506178B (en) Page jump management method and device
CN105138579A (en) Method and device for obtaining keywords and recommending information based on keywords
CN107861966B (en) Cache detection method, equipment and computer readable storage medium
CN107305528B (en) Application testing method and device
CN107357612A (en) Application program updating detection method and device
CN109711149B (en) Dynamic updating mechanism judging method and application full life cycle behavior monitoring method
CN103973506A (en) Domain name verifying method, device and system
CN112835808A (en) Interface testing method and device, computer equipment and storage medium
CN106802821B (en) Method and device for identifying installation source of application program
US11695793B2 (en) Vulnerability scanning of attack surfaces
CN106775795A (en) A kind of method and apparatus that service is provided for hypbrid app
EP2998885A1 (en) Method and device for information search
CN109951549B (en) Network page access method and device and computer readable storage medium
KR20160032653A (en) Method and apparatus for ranking candiate character and method and device for inputting character
CN111597557A (en) Malicious application detection method, system, device, equipment and storage medium
CN107908961B (en) Malicious webpage detection method, equipment and storage medium based on virtualization

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant