Resource caching method and device
- xyli83
- Jan 5, 2018
- 4 min read
Medicilon’s Chemistry department has more than 100 chemists, who are experienced in the cooperation with major domestic and international pharmaceutical and biotech companies. Our services cover a variety of research interests in novel drug research, including target validation, hits evaluation, lead optimization, candidate nomination, preclinical development and IND filing. Email:marketing@medicilon.com.cn web:www.medicilon.com
The invention discloses a resource caching method and a resource caching device, used for achieving an automatic cache generation rule according to cache log resources. The method comprises the steps of acquiring domain names to be analyzed; acquiring cache logs corresponding to any domain name to be analyzed within a specified time slot; extracting first class key information from any cache log corresponding to the domain name to be analyzed; at least determining whether the cache log is an optimizable cache log according to the first class key information; and if the cache log is determined to be the optimizable cache log, inputting domain name field information of URL in the cache log into a regular expression corresponding to a resource depth level of the URL, and generating the cache rule of the cache log. According to the method provided by the invention, the corresponding cache rule can be automatically generated according to the resource depth and specified domain name of the optimizable cache log, the generates regular expression is more pointed, setting of each cache parameter of the new cache rule is more reasonable, and cache efficiency can be effectively enhanced.
Embodiments of the present invention provides a resource cache apparatus, comprising:
a first obtaining unit, configured to obtain the domain name to be analyzed;
a second obtaining unit configured for corresponding to any one domain to be analyzed, obtaining the specified period cache log domain to be analyzed;resource analyzing unit, a buffer for any corresponding to the log domain to be analyzed from the extract of the first type key information; and at least determining whether the cache is a log log buffer can be optimized in accordance with the first-type key information;
The rule generation means for determining if the cache is a log log optimizes the cache, then the cache domain name field in the log information input resource URL to the URL depth levels corresponding to the regular expression, generate the cache caching rules logs;
wherein the resource URL depth levels corresponding to the regular expression parameter is at least the depth of resources according to the buffer level of the resource and the URL depth level corresponding to the regular expressions prepared in advance.
The above-described embodiments, gets the specified time period corresponding to the domain name to be analyzed log buffer, a first type from the key information corresponding to any one domain to be analyzed to extract the log buffer, such as hit identification, HTTP status code resource size , resource URL, and whether the general rule matching the data cache, the cache and to determine at least whether a log log buffer can be optimized according to a first type key information; further optimize available resources according to the specified depth and the log domain name cache URL automatically generate the corresponding cache rULES; regular expressions to analyze particular paradigm domain, and generates the resource URL different depths according more targeted, each of the more reasonable cache parameters set, according to the subsequent optimized cache caching rules can be shortened domain optimization of the length of time matching the caching rules, can effectively enhance the efficiency of the cache.
In order to analyze whether the domain name is determined to be a variety of types of links required resource optimization and the optimization space corresponding to the first, the need for any analysis taken to be a domain name, the domain to be analyzed obtaining any of the corresponding cached log, secondly, to get the same domain name to be analyzed corresponding cache log parsing; again, according to the analysis results, to be analyzed to determine whether the domain name corresponding cache resources need to be optimized.
Preferably, the cache server via the specified interface, the interface is the designated cache Cache Optimizer existing network cache server after docking completion interface, for reading the specified time period corresponding to the domain name to be analyzed log cache. The specified interface is packaged as a read function can be provided within a specified time log, the interface may be read from the input start time to the period between the end of the cache server recorded or input time access log in the log directory (access log), the log buffer to the local copy of the read cache log records all the information a user through a straight path upstream request.
Automatically caching log acquisition embodiments were analyzed using the analysis function module having resources embodiment [0037] of the present invention. Specifically, in step 103, the same analysis to be acquired corresponding to the domain name parsing log buffer, and the first type is extracted from the key information corresponding to the domain name to be analyzed according to any one cached log, the first key information extracted includes at least HTTP status code, also include: hit identification, resource size, URL and other resources.
Among them, hit identification includes the meaning TCP_HIT and TCP_MISS, TCP_HIT of cache hits Cache server resources, TCP_MISS the meaning of cache misses Cache server resources.
wherein, if the parsed fragment field buffer log include a matching identification information common cache matches the rule, constituting the common cache rule that cache log is determined to match; if parsing cache log does not contain a common cache rule match the identification information matches, it is determined that the general configuration of the cache rule does not match the log buffer.
Example embodiments of the present invention to provide an alternative type of a first key information, determining whether the cache is a log log optimizes the cache ways, according to: if the first key information based HTTP (HyperText Transfer Protocol, hypertext transfer protocol) HTTP status code for the specified key type and the first status code information does not match the identification information includes the log buffer to the general rule that matches the cache, the cache is determined to be optimized log log cache.
Comments