CN106933965A - The method of static resource request - Google Patents

The method of static resource request Download PDF

Info

Publication number
CN106933965A
CN106933965A CN201710068648.6A CN201710068648A CN106933965A CN 106933965 A CN106933965 A CN 106933965A CN 201710068648 A CN201710068648 A CN 201710068648A CN 106933965 A CN106933965 A CN 106933965A
Authority
CN
China
Prior art keywords
static file
static
address
file
request
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.)
Granted
Application number
CN201710068648.6A
Other languages
Chinese (zh)
Other versions
CN106933965B (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.)
Fujian Hua Yu Education Technology Co Ltd
Original Assignee
Fujian Hua Yu Education Technology 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 Fujian Hua Yu Education Technology Co Ltd filed Critical Fujian Hua Yu Education Technology Co Ltd
Priority to CN201710068648.6A priority Critical patent/CN106933965B/en
Publication of CN106933965A publication Critical patent/CN106933965A/en
Application granted granted Critical
Publication of CN106933965B publication Critical patent/CN106933965B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. 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)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present invention provides a kind of method of static resource request, including:Service end chooses at least two static file according to default selection rule;Store in static file to the default buffer area chosen;The address of the static file to choosing recombinates, and obtains new address;Associate the static file and corresponding new address chosen;Receive the request that client sends;Corresponding static file is searched in buffer area according to the address of the request;The static file that will be found is sent to client.Service end is chosen and is cached to static file, and generate new address corresponding with the static file chosen, therefore when client sends request, can according to request new address searched in buffer area it is corresponding before service end choose static file, hyperlink request quantity is reduced, page response speed is improve.

Description

The method of static resource request
Technical field
The present invention relates to technical field of webpage processing, more particularly to a kind of method that static resource is asked.
Background technology
The page presentation of current browser and interaction are relative complex, it is necessary to use the static text such as substantial amounts of css, js, img Part, and the concurrent request number of resources that browser is allowed is limited, therefore easily there is the situation that page presentation is slow or displaying is abnormal.
Generally, the static files such as css, js, img are placed under different domain names, being capable of relative increase browser The concurrent request number of resources of permission, is such as put into http by css://zhihu.com, img are put into http://zhimg.com, then Css and img just can be with concurrent requests.But the ability that this method increases concurrent request number of resources is extremely limited.
The method that the Chinese patent of the A of Publication No. CN 104063431 proposes treatment static resource, including:Treatment is quiet Each webpage within a specified time uses the information of static resource under the equipment of state resource obtains website;The treatment static resource Equipment within a specified time accesses the situation of the network that each webpage is used according to each webpage using the information of static resource and user, Determine whether the static resource that each webpage is used can merge.Static resource can be determined in the case where need not manually participate in Between whether can merge, be advantageously implemented the merging between static resource, improve web site performance, but the program is directed to net The page page, and the program is to access the network that each webpage is used using the information of static resource and user according in the time of specifying Situation determines whether static resource merges, the raising limitation of page response speed, and cannot ensure to respond to client Content be newest content.
The content of the invention
The technical problems to be solved by the invention are:A kind of method and system of static resource request are provided, can be merged Static resource, and the static resource after merging is searched in the form of path, it is effective to reduce request connection quantity, improve page sound Answer speed.
In order to solve the above-mentioned technical problem, the technical solution adopted by the present invention is:
A kind of method of static resource request, including:
Service end chooses at least two static file according to default selection rule;
Store in static file to the default buffer area chosen;
The address of the static file to choosing recombinates, and obtains new address;
Associate the static file and corresponding new address chosen;
Receive the request that client sends;
Corresponding static file is searched in buffer area according to the address of the request;
The static file that will be found is sent to client.
The beneficial effects of the present invention are:Service end is chosen some static files and is cached, one new address of regeneration and The static file association of selection, then it is content after being merged by the static file chosen that new address is corresponding, therefore client is sent out When sending request, the static file after corresponding merging can be searched in buffer area according to the address of request, reduce request chain Quantity is connect, page response speed is improve.
Brief description of the drawings
The schematic flow sheet of the method that Fig. 1 is asked for the static resource of the embodiment of the present invention;
The schematic flow sheet of the method that Fig. 2 is asked for the static resource of the embodiment of the present invention one.
Specific embodiment
It is to describe technology contents of the invention, the objects and the effects in detail, below in conjunction with implementation method and coordinates attached Figure is explained.
The design of most critical of the present invention is:Service end chooses static file, and the static file of selection is stored to pre- If buffer area in;The address of the static file to choosing recombinates, and obtains new address;Associate the static file and right chosen The new address answered.
Fig. 1 is refer to, the present invention is provided:
A kind of method of static resource request, including:
Service end chooses at least two static file according to default selection rule;
Store in static file to the default buffer area chosen;
The address of the static file to choosing recombinates, and obtains new address;
Associate the static file and corresponding new address chosen;
Receive the request that client sends;
Corresponding static file is searched in buffer area according to the address of the request;
The static file that will be found is sent to client.
Knowable to foregoing description, service end is chosen and is cached to static file, and generates and the static file chosen Corresponding new address, thus client send request when, can according to request new address searched in buffer area it is corresponding it The static file that preceding service end is chosen, reduces hyperlink request quantity, improves page response speed.
Further, receive after the request that client sends, it is right to be searched in buffer area according to the address of the request Before the static file answered, also including the newest modification time of all static files in reading service end;According to the request Corresponding static file is searched in buffer area and is specifically included in address:
Address according to the newest modification time and the request is calculated, and generates character string;
Corresponding static file is searched in buffer area according to the character string.
Knowable to foregoing description, the address according to above-mentioned newest modification time and request is calculated, the character string of generation Can point at the static file of newest modification, it is ensured that the static file for finding all is newest.
Further, after searching corresponding static file in the buffer area according to the character string, further include:
If not finding corresponding static file in buffer area, the static file in batch composite services end;
The static file of batch combination is stored to buffer area;
By the static file and the string association of batch combination;
The static file of batch combination is sent to client.
Knowable to foregoing description, if finding corresponding static file in buffer area according to the character string, illustrate The address of request recombinate the new address for obtaining for service end, if not finding correspondence in buffer area according to the character string Static file, then illustrate request content before not serviced end carry out, cache and generate new address, therefore, need to service Static file in end returns again to client after carrying out batch combination, and directly can not be obtained from buffer;In addition, by batch group Close after static file store to buffer area, and with the string association, then this batch combine after static file and institute Character string correspondence is stated, corresponding static file directly can be found in buffer area when asking next time.
Further, before service end chooses static file according to default selection rule, further include:
Service end configuring request rule, file directory and buffer area, the request rule is for adding the new address, institute File directory is stated for all of static file in storage service end, the buffer area is used to store the static file chosen.
Further, association choose static file and corresponding new address after, receive client send request it Before, further include:
The new address for generating is sent to client.
Knowable to foregoing description, after client gets the new address of generation, you can corresponding quiet using new Address requests State file.
Further, the buffer area is distribution key/value databases.
Knowable to foregoing description, buffer area can use generic file system, it would however also be possible to employ above-mentioned distributed key/ Value databases.
Further, the static file in buffer area is compressed by the way of gzip or deflate, and stores pressure Static file after contracting.
Knowable to foregoing description, the static file in buffer area is the compressed format for matching client, can be effectively improved The efficiency of transmission of static file.
Further, before the address of the static file to choosing recombinates, also include:Preset address reformulation rule; The address of the static file to choosing recombinates, and obtains new address and is specially:According to the address reformulation rule to selection The address of static file is recombinated, and obtains new address.
Knowable to foregoing description, by preset address reformulation rule, then can be automatic quiet to what is chosen according to address restructuring State file enters row address restructuring, new address is obtained, when such as address reformulation rule is by the address of each static file and newest modification Between carry out it is simple plus and, the address of static file 1 is D1, and the address of static file 2 is D2, then using address reformulation rule to choosing The static file 1 and the row address that enters of static file 2 for taking are reassembled as D1D2.Add and mode except simple, it is also possible to using existing Other address reformulation rules having.
Fig. 2 is refer to, embodiments of the invention one are:
A kind of method of static resource request, including:
Service end configuring request rule, file directory and buffer area, and preset address reformulation rule;The request rule For adding the new address, the file directory is used for all of static file in storage service end, and the buffer area is used for Store the static file chosen;Specifically, the buffer area is distribution key/value databases;
Service end chooses multiple static files according to default selection rule in html file;
Compression is merged to the static file chosen using gzip the or deflate compression algorithms of support client, and Static file after storage compression;
The address of the static file according to the address reformulation rule to choosing recombinates, and obtains new address;Will be described New address is regular added to the request;
Associate the static file and corresponding new address chosen;Specifically, using new address as key, the static file of selection As value;In said process, the quantity of the static file chosen every time is multiple, often chooses a static file, then to deserved To a new address;
The new address that will be obtained is sent to each client;
Receive the request that client sends;The request is Address requests;
The newest modification time of all static files in reading service end;
Address to the newest modification time and the request carries out md5 calculating, generates character string;
Using the character string as key, corresponding static file is searched in buffer area;
If finding corresponding static file in buffer area, the static file that will be found is sent to client;
If not finding corresponding static file in buffer area, the static file in batch composite services end;To criticize The static file for measuring combination is stored to buffer area;Using the character string as key, the static file after batch combination is used as value;Will The static file of batch combination is sent to client.
Here is a concrete application scene of above-described embodiment:
Service end chooses static file 1 (address is D1), static file 2 (address is D2) and static state text from html file Part 3 (address is D3), merges to static file 1, static file 2 and static file 3 and compresses, and stores to buffer area, to D1, D2 With D3 recombinate and obtain address D 1D2D3, using D1D2D3 as key, static file 1, static file 2 and static state text in buffer area Part 3 merges the content after compression as value;Similarly, other multigroup static files are selected, is compressed and is stored to buffer area, with And (such as D4D5 is key, after static file 4 and static file 5 merge compression in buffer area with corresponding new address information respectively Content is used as value).
Client sends Address requests to service end, and the newest modification time of all static files, right in reading service end The address of newest modification time and the request carries out md5 calculating, generates character string, it is assumed that the character string is D1D2D3, then will D1D2D3, with D1D2D3 as key, searches the static file in buffer area, the static file 1 that will be found, static file 2 and quiet The content that state file 3 merges after compression is sent to client;If the character string is D8D9, and do not found in corresponding in buffer area Hold, then service end does not choose static file 8 and static file 9 before illustrating, therefore static state is directly searched in html file File 8 and static file 9, store to buffer area after static file 8 and static file 9 are merged into compression, and using D8D9 as key, The content that static file 8 and static file 9 merge after compression merges compression as value, and by static file 8 and static file 9 Content afterwards is sent to client.When next client sends the Address requests that address is D8D9, then directly will be quiet in buffer area The content that state file 8 and static file 9 merge after compression is back to client.
In sum, the method for the static resource request that the present invention is provided, is chosen to static resource, is merged, and Corresponding new address is produced, the new multiple static files for merging of address correspondence, so as to reduce request connection number, improve static money The concurrent request number in source, and then improve page response speed.
Embodiments of the invention are the foregoing is only, the scope of the claims of the invention is not thereby limited, it is every to utilize this hair The equivalents that bright specification and accompanying drawing content are made, or the technical field of correlation is directly or indirectly used in, similarly include In scope of patent protection of the invention.

Claims (8)

1. a kind of method that static resource is asked, it is characterised in that including:
Service end chooses at least two static file according to default selection rule;
Store in static file to the default buffer area chosen;
The address of the static file to choosing recombinates, and obtains new address;
Associate the static file and corresponding new address chosen;
Receive the request that client sends;
Corresponding static file is searched in buffer area according to the address of the request;
The static file that will be found is sent to client.
2. static resource requesting method according to claim 1, it is characterised in that receive request that client sends it Afterwards, before corresponding static file being searched in buffer area according to the address of the request, also including owning in reading service end The newest modification time of static file;Corresponding static file is searched in buffer area according to the address of the request specifically to wrap Include:
Address according to the newest modification time and the request is calculated, and generates character string;
Corresponding static file is searched in buffer area according to the character string.
3. the method that static resource according to claim 2 is asked, it is characterised in that according to the character string in buffer area Interior lookup further include after corresponding static file:
If not finding corresponding static file in buffer area, the static file in batch composite services end;
The static file of batch combination is stored to buffer area;
By the static file and the string association of batch combination;
The static file of batch combination is sent to client.
4. static resource requesting method according to claim 1, it is characterised in that service end is according to default selection rule Before choosing static file, further include:
Service end configuring request rule, file directory and buffer area, the request rule is for adding the new address, the text Part catalogue is used for all of static file in storage service end, and the buffer area is used to store the static file chosen.
5. the method for static resource according to claim 1 request, it is characterised in that static file that association is chosen and right After the new address answered, before receiving the request that client sends, further include:
The new address that will be obtained is sent to client.
6. the method that static resource according to claim 1 is asked, it is characterised in that the buffer area is distribution key/ Value databases.
7. the method that static resource according to claim 1 is asked, it is characterised in that using the side of gzip or deflate Formula is compressed to the static file in buffer area, and stores the static file after compression.
8. the method that static resource according to claim 1 is asked, it is characterised in that the address of the static file to choosing Before being recombinated, also include:Preset address reformulation rule;The address of the static file to choosing recombinates, and obtains newly Location is specially:The address of the static file according to the address reformulation rule to choosing recombinates, and obtains new address.
CN201710068648.6A 2017-02-08 2017-02-08 Method for requesting static resource Active CN106933965B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710068648.6A CN106933965B (en) 2017-02-08 2017-02-08 Method for requesting static resource

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710068648.6A CN106933965B (en) 2017-02-08 2017-02-08 Method for requesting static resource

Publications (2)

Publication Number Publication Date
CN106933965A true CN106933965A (en) 2017-07-07
CN106933965B CN106933965B (en) 2020-05-15

Family

ID=59424724

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710068648.6A Active CN106933965B (en) 2017-02-08 2017-02-08 Method for requesting static resource

Country Status (1)

Country Link
CN (1) CN106933965B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108566411A (en) * 2018-02-07 2018-09-21 链家网(北京)科技有限公司 Static resource acquisition methods, electronic equipment and storage medium
CN110609942A (en) * 2019-09-06 2019-12-24 达疆网络科技(上海)有限公司 LBS positioning-based method for calculating address grid storage APP resources
CN110636111A (en) * 2019-08-22 2019-12-31 北京达佳互联信息技术有限公司 Resource packaging method and device, electronic equipment and storage medium
CN111367673A (en) * 2020-03-05 2020-07-03 山东中创软件商用中间件股份有限公司 Static resource acquisition method, device and related equipment
CN112632440A (en) * 2020-12-18 2021-04-09 西安博达软件股份有限公司 Static resource generation method for teacher personal homepage based on watermark characteristic rule string
CN112632427A (en) * 2020-12-25 2021-04-09 航天信息股份有限公司 Page static resource management system and method based on front-end agent
CN115203075A (en) * 2022-06-27 2022-10-18 威胜电气有限公司 Distributed dynamic mapping cache design method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6389460B1 (en) * 1998-05-13 2002-05-14 Compaq Computer Corporation Method and apparatus for efficient storage and retrieval of objects in and from an object storage device
CN103020155A (en) * 2012-11-23 2013-04-03 中国电信股份有限公司云计算分公司 Web front end resource request processing method and device
CN103051706A (en) * 2012-12-19 2013-04-17 新浪网技术(中国)有限公司 Dynamic webpage request processing system and method for dynamic website
CN103136290A (en) * 2011-12-05 2013-06-05 金蝶软件(中国)有限公司 Processing method and processing device of web script file
US20130185322A1 (en) * 2012-01-12 2013-07-18 Aaron James Vegh Systems and methods for providing an electronic contact card
CN104063431A (en) * 2014-06-10 2014-09-24 百度在线网络技术(北京)有限公司 Method and equipment for processing static resources
CN104199951A (en) * 2014-09-12 2014-12-10 百度在线网络技术(北京)有限公司 Webpage processing method and webpage processing device
CN106293675A (en) * 2015-06-08 2017-01-04 腾讯科技(深圳)有限公司 Static system resource loading method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6389460B1 (en) * 1998-05-13 2002-05-14 Compaq Computer Corporation Method and apparatus for efficient storage and retrieval of objects in and from an object storage device
CN103136290A (en) * 2011-12-05 2013-06-05 金蝶软件(中国)有限公司 Processing method and processing device of web script file
US20130185322A1 (en) * 2012-01-12 2013-07-18 Aaron James Vegh Systems and methods for providing an electronic contact card
CN103020155A (en) * 2012-11-23 2013-04-03 中国电信股份有限公司云计算分公司 Web front end resource request processing method and device
CN103051706A (en) * 2012-12-19 2013-04-17 新浪网技术(中国)有限公司 Dynamic webpage request processing system and method for dynamic website
CN104063431A (en) * 2014-06-10 2014-09-24 百度在线网络技术(北京)有限公司 Method and equipment for processing static resources
CN104199951A (en) * 2014-09-12 2014-12-10 百度在线网络技术(北京)有限公司 Webpage processing method and webpage processing device
CN106293675A (en) * 2015-06-08 2017-01-04 腾讯科技(深圳)有限公司 Static system resource loading method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ITPINPAI: "【前端开发】合并多个前端静态资源文件,减少HTTP请求次数", 《HTTPS://BLOG.CSDN.NET/ITPINPAI/ARTICLE/DETAILS/52779399》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108566411A (en) * 2018-02-07 2018-09-21 链家网(北京)科技有限公司 Static resource acquisition methods, electronic equipment and storage medium
CN110636111A (en) * 2019-08-22 2019-12-31 北京达佳互联信息技术有限公司 Resource packaging method and device, electronic equipment and storage medium
CN110609942A (en) * 2019-09-06 2019-12-24 达疆网络科技(上海)有限公司 LBS positioning-based method for calculating address grid storage APP resources
CN110609942B (en) * 2019-09-06 2023-12-05 达疆网络科技(上海)有限公司 Method for storing APP resources by calculating address square grid based on LBS positioning
CN111367673A (en) * 2020-03-05 2020-07-03 山东中创软件商用中间件股份有限公司 Static resource acquisition method, device and related equipment
CN112632440A (en) * 2020-12-18 2021-04-09 西安博达软件股份有限公司 Static resource generation method for teacher personal homepage based on watermark characteristic rule string
CN112632440B (en) * 2020-12-18 2023-01-24 西安博达软件股份有限公司 Static resource generation method for teacher personal homepage based on watermark characteristic rule string
CN112632427A (en) * 2020-12-25 2021-04-09 航天信息股份有限公司 Page static resource management system and method based on front-end agent
CN115203075A (en) * 2022-06-27 2022-10-18 威胜电气有限公司 Distributed dynamic mapping cache design method
CN115203075B (en) * 2022-06-27 2024-01-19 威胜能源技术股份有限公司 Distributed dynamic mapping cache design method

Also Published As

Publication number Publication date
CN106933965B (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN106933965A (en) The method of static resource request
US10785322B2 (en) Server side data cache system
US10491534B2 (en) Managing resources and entries in tracking information in resource cache components
JP6091579B2 (en) Method and apparatus for handling nested fragment caching of web pages
CN105095226B (en) Web page resources loading method and device
CN104184832B (en) Data submission method and device in network application
US7398271B1 (en) Using network traffic logs for search enhancement
AU2007313747B2 (en) Content request optimization
USRE42169E1 (en) Method, apparatus, and computer program product for efficient server response generation using intermediate state caching
US20160344842A1 (en) Identifying content files in a cache using a response-based cache index
US20120310941A1 (en) System and method for web-based content categorization
CN104714965A (en) Static resource weight removing method, and static resource management method and device
CN103383687A (en) Page processing method and device
CN108256014A (en) Page display method and device
CN110213392A (en) Data distributing method, device, computer equipment and storage medium
JP2002108671A (en) Method and system for providing customized information in computer processing system
CN105934930A (en) Method and apparatus for obtaining content from a media server
US7539776B1 (en) Dynamic uniform resource locator compression
CN104980464A (en) Network request processing method, network server and network system
US20180302489A1 (en) Architecture for proactively providing bundled content items to client devices
JP2008070949A (en) Web page generation system, web page generation device and web page generation method
CN109241021A (en) A kind of file polling method, apparatus, equipment and computer readable storage medium
CN110807040B (en) Method, device, equipment and storage medium for managing data
JP5322072B1 (en) Numbered ticket issuing system for web access
JP2003242017A (en) Method and system for information disclosure

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