CN107306292A - Service end webpage includes implementation method and device - Google Patents

Service end webpage includes implementation method and device Download PDF

Info

Publication number
CN107306292A
CN107306292A CN201610261235.5A CN201610261235A CN107306292A CN 107306292 A CN107306292 A CN 107306292A CN 201610261235 A CN201610261235 A CN 201610261235A CN 107306292 A CN107306292 A CN 107306292A
Authority
CN
China
Prior art keywords
static file
caching
file
static
ssi
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.)
Pending
Application number
CN201610261235.5A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Shangke Information 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 Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Shangke Information Technology Co Ltd
Priority to CN201610261235.5A priority Critical patent/CN107306292A/en
Publication of CN107306292A publication Critical patent/CN107306292A/en
Pending legal-status Critical Current

Links

Classifications

    • 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)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Implementation method and device are included this application discloses a kind of service end webpage, wherein method includes:Service end in webpage response data is parsed comprising (SSI) instruction, the static file path configured in the SSI instructions is obtained;According to the static file path, according to the strategy that file is preferentially obtained from caching, the corresponding static file in the static file path is obtained, and SSI instructions are replaced using the content of the static file.Using the present invention, the concurrency performance of system can be improved.

Description

Service end webpage includes implementation method and device
Technical field
The present invention relates to internet technique, more particularly to a kind of service end webpage includes implementation method and device.
Background technology
There are many scenes being embedded on service end webpage when Website development is carried out.By net in these scenes Page content (i.e. webpage response data) is sent to before browser, it is necessary to perform service end webpage and operated comprising processing, Text, figure or application information are covered in webpage using Server Side Include (SSI) instruction, to realize Server page includes function.
At present, the web page server such as Tomcat, Nginx and apache web is grasped in progress service end webpage comprising processing When making, the processing mode and realization principle of use are all substantially similar.All it is to need to refer to the SSI in webpage response data Make and being parsed, obtain the static file path configured in SSI instructions, request static state text is then gone by server again Static file under part path, the content of the static file finally obtained using request is instructed to replace the SSI, so that Realize that server page includes function.
, all can be real-time during each dissection process SSI instructions in above-mentioned traditional service end webpage includes implementation Ground removes the static file configured in the request of loading instruction, so, when have it is substantial amounts of concurrently access when, will be continually Disk access operation is carried out, so as to inevitably reduce the concurrency performance of system.
As can be seen here, existing service end webpage includes implementation, under substantial amounts of concurrent access scenario, can reduce The concurrency performance of system.
The content of the invention
In view of this, can it is a primary object of the present invention to provide a kind of service end webpage to include implementation method and device To improve the concurrency performance of system.
In order to achieve the above object, technical scheme proposed by the present invention is:
A kind of service end webpage includes processing method, including:
Service end in webpage response data is parsed comprising (SSI) instruction, obtains and is configured in the SSI instructions Static file path;
According to the static file path, according to the strategy that file is preferentially obtained from caching, the static file is obtained The corresponding static file in path, and SSI instructions are replaced using the content of the static file.
A kind of service end webpage includes and realizes device, including:
Command analysis module, for being parsed to the service end in webpage response data comprising SSI instructions, obtains institute State the static file path configured in SSI instructions;
Data processing module, for according to the static file path, according to the strategy that file is preferentially obtained from caching, The corresponding static file in the static file path is obtained, and the SSI is instructed using the content of the static file It is replaced.
In summary, service end webpage proposed by the present invention includes implementation method and device, is replaced carrying out SSI instructions When, according to the strategy that file is preferentially obtained from caching, the static file for replacing SSI instructions is obtained, in this way, It can effectively be reduced under the larger scene of concurrent visit capacity to the read operation of file-storage device, so as to improve and be The concurrency performance of system.
Brief description of the drawings
Fig. 1 is the method flow schematic diagram of the embodiment of the present invention;
Fig. 2 is the apparatus structure schematic diagram of the embodiment of the present invention.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing and specific implementation The present invention is described in further detail for example.
The present invention core concept be:The corresponding static text of static path in SSI instructions is preferentially read from caching Part, influence when concurrently being accessed with reducing to system concurrency performance.
Fig. 1 is the schematic flow sheet of the embodiment of the present invention one, as shown in figure 1, the service end that the embodiment is realized Webpage mainly includes comprising implementation method:
Step 101, the service end in webpage response data is parsed comprising (SSI) instruction, obtained described The static file path configured in SSI instructions.
This step, obtains the static file path configured in SSI instructions, to read for parsing SSI instructions Corresponding static file.The concrete methods of realizing of this step will not be repeated here compared with system.
Step 102, according to the static file path, according to the strategy that file is preferentially obtained from caching, obtain The corresponding static file in the static file path, and the SSI is instructed using the content of the static file It is replaced.
, it is necessary to obtain the corresponding static file in the static file path in this step, static state text is then utilized Part is replaced processing to corresponding SSI instructions.Here, when obtaining the static file for replacing SSI instructions, Need, using the preferential strategy realization obtained from caching, to store file during substantial amounts of concurrently access to reduce The read operation of equipment, so as to effectively improve the concurrency performance of system.
It is preferred that specifically institute can be obtained using following methods according to the strategy that file is preferentially obtained from caching State the corresponding static file in static file path:
Determine that static file under the static file path whether there is in caching, if it is, from described The static file is read in caching, otherwise, the static file is read under the static file path, and Preserve into caching.
In the above-mentioned methods, when needing to obtain the static file configured in SSI instructions, pay the utmost attention to from caching Middle reading file, asks to load the static file under the static file path again when in caching not having, and In deposit caching, when needing to again read off this document so as to next time, directly it can be obtained from caching, just The access operation of file-storage device need not be carried out again, it is possible to reduce the access time to disk when concurrently accessing Number.
In actual applications, judge the static file under static file path with the presence or absence of the specific side in caching Method is grasped by those skilled in the art, will not be repeated here.
It is preferred that methods described may further include following step:
When reaching predetermined threshold value the holding time of the static file in the buffer, institute is deleted from the caching State static file.
In above-mentioned steps, when the static file in caching reaches the certain time i.e. threshold value, postponed Middle deletion is deposited, so, the weight when needing to be read out static file next time, it is necessary to from file-storage device Newest file is newly read into caching, the file failure preserved in caching can be so avoided, it is ensured that in caching File and file memory in file be consistent, and then ensure the correctness of webpage response data.
The threshold value is used to ensure the validity of static file, specifically can be by those skilled in the art according to reality File maintenance situation, sets appropriate value, to ensure to realize above-mentioned functions.
It is that can be achieved to be replaced place to the SSI instructions in webpage response data using above-mentioned steps 101 and 102 Reason, so that completing service end webpage includes processing procedure.In actual applications, as existing system, complete After replacing processing operation into SSI instructions, resulting webpage response data repack to be sent to visitor Family end browser, you can corresponding data content is shown by browser.
In actual applications, above-described embodiment realize service end webpage comprising implementation specifically can Tomcat, Realized on the web page servers such as Nginx and apache web.
Fig. 2 is included for a kind of service end webpage corresponding with the above method and is realized apparatus structure schematic diagram, such as Fig. 2 Shown, the device includes:
Command analysis module, for being parsed to the service end in webpage response data comprising SSI instructions, is obtained Obtain the static file path configured in the SSI instructions;
Data processing module, for according to the static file path, according to the preferentially acquisition file from caching Strategy, obtains the corresponding static file in the static file path, and utilize the content of the static file to institute SSI instructions are stated to be replaced.
It is preferred that the data processing module, for whether determining the static file under the static file path It is present in caching, if it is, the static file is read from the caching, otherwise, from the static state The static file is read under file path, and is preserved into caching.
It is preferred that the data processing module, it is further used for when static file preservation in the buffer Between when reaching predetermined threshold value, the static file is deleted from the caching.
It can be seen from the above technical proposal that service end webpage proposed by the present invention includes implementation method and device, When carrying out SSI instruction replacements, according to the strategy that file is preferentially obtained from caching, obtain for replacing SSI The static file of instruction, in this way, can effectively reduce and stored to file under the larger scene of concurrent visit capacity The read operation of equipment, so as to improve the concurrency performance of system.
In summary, presently preferred embodiments of the present invention is these are only, the protection of the present invention is not intended to limit Scope.Within the spirit and principles of the invention, any modification, equivalent substitution and improvements made etc., It should be included within protection scope of the present invention.

Claims (6)

1. a kind of service end webpage includes implementation method, it is characterised in that including:
Service end in webpage response data is parsed comprising SSI instructions, obtains what is configured in the SSI instructions Static file path;
According to the static file path, according to the strategy that file is preferentially obtained from caching, the static file is obtained The corresponding static file in path, and SSI instructions are replaced using the content of the static file.
2. according to the method described in claim 1, it is characterised in that described according to the preferentially acquisition file from caching Strategy, obtaining the corresponding static file in the static file path includes:
Determine that static file under the static file path whether there is in caching, if it is, from the caching It is middle to read the static file, otherwise, the static file is read under the static file path, and preserve to slow In depositing.
3. according to the method described in claim 1, it is characterised in that methods described further comprises:When the static state When the holding time of file in the buffer reaches predetermined threshold value, the static file is deleted from the caching.
4. a kind of service end webpage includes and realizes device, it is characterised in that including:
Command analysis module, for being parsed to the service end in webpage response data comprising SSI instructions, obtains institute State the static file path configured in SSI instructions;
Data processing module, for according to the static file path, according to the strategy that file is preferentially obtained from caching, The corresponding static file in the static file path is obtained, and the SSI is instructed using the content of the static file It is replaced.
5. device according to claim 4, it is characterised in that the data processing module, described for determining Static file under static file path whether there is in caching, if it is, being read from the caching described quiet State file, otherwise, reads the static file, and preserve into caching under the static file path.
6. device according to claim 4, it is characterised in that the data processing module, is further used for working as When the holding time of the static file in the buffer reaches predetermined threshold value, the static file is deleted from the caching.
CN201610261235.5A 2016-04-25 2016-04-25 Service end webpage includes implementation method and device Pending CN107306292A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610261235.5A CN107306292A (en) 2016-04-25 2016-04-25 Service end webpage includes implementation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610261235.5A CN107306292A (en) 2016-04-25 2016-04-25 Service end webpage includes implementation method and device

Publications (1)

Publication Number Publication Date
CN107306292A true CN107306292A (en) 2017-10-31

Family

ID=60150351

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610261235.5A Pending CN107306292A (en) 2016-04-25 2016-04-25 Service end webpage includes implementation method and device

Country Status (1)

Country Link
CN (1) CN107306292A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108366021A (en) * 2018-01-12 2018-08-03 北京奇虎科技有限公司 A kind of method and system of the concurrent web page access business of processing

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729598A (en) * 2009-11-18 2010-06-09 福建星网锐捷网络有限公司 Method and system for increasing Web service response speed and network processor
CN103064932A (en) * 2012-12-24 2013-04-24 乐视网信息技术(北京)股份有限公司 System and method for processing static page
CN103324756A (en) * 2013-07-09 2013-09-25 星云融创(北京)信息技术有限公司 Method and device for increasing access speed of browser
US20140074962A1 (en) * 2012-09-13 2014-03-13 Konica Minolta Inc. Browser device, browser program, browser system, image forming apparatus, and non-transitory storage medium
CN103747030A (en) * 2013-12-12 2014-04-23 浪潮电子信息产业股份有限公司 Nginx server intelligent cache method based on improved particle swarm optimization
CN104243620A (en) * 2014-10-17 2014-12-24 浪潮电子信息产业股份有限公司 High-performance WEB production environment framework

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729598A (en) * 2009-11-18 2010-06-09 福建星网锐捷网络有限公司 Method and system for increasing Web service response speed and network processor
US20140074962A1 (en) * 2012-09-13 2014-03-13 Konica Minolta Inc. Browser device, browser program, browser system, image forming apparatus, and non-transitory storage medium
CN103064932A (en) * 2012-12-24 2013-04-24 乐视网信息技术(北京)股份有限公司 System and method for processing static page
CN103324756A (en) * 2013-07-09 2013-09-25 星云融创(北京)信息技术有限公司 Method and device for increasing access speed of browser
CN103747030A (en) * 2013-12-12 2014-04-23 浪潮电子信息产业股份有限公司 Nginx server intelligent cache method based on improved particle swarm optimization
CN104243620A (en) * 2014-10-17 2014-12-24 浪潮电子信息产业股份有限公司 High-performance WEB production environment framework

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108366021A (en) * 2018-01-12 2018-08-03 北京奇虎科技有限公司 A kind of method and system of the concurrent web page access business of processing
CN108366021B (en) * 2018-01-12 2022-04-01 北京奇虎科技有限公司 Method and system for processing concurrent webpage access service

Similar Documents

Publication Publication Date Title
US11647096B2 (en) Method and apparatus for automatically optimizing the loading of images in a cloud-based proxy service
CN109240946B (en) Multi-level caching method of data and terminal equipment
CN103338249B (en) Caching method and device
CN102789470B (en) The method and apparatus of the picture in loading webpage
EP3734933A1 (en) Resource acquisition method, resource return method, server and storage medium
CN104601691A (en) Method and system for increasing loading speed of Web site resource
CN102789454B (en) The instant storage means of input frame content in a kind of browsing device net page and system
US20120011262A1 (en) Method and System of Processing Cookies Across Domains
CN105183839A (en) Hadoop-based storage optimizing method for small file hierachical indexing
CN102479250A (en) Disk caching method for embedded browser
US8943275B1 (en) Differential storage and eviction for information resources from a browser cache
CN105550338A (en) HTML5 application cache based mobile Web cache optimization method
CN106021445A (en) Cached data loading method and apparatus
CN103297476B (en) Method and device for loading webpage game
CN102799613A (en) Showing method and device for recently-used file
CN103699554A (en) Webpage data calling method and device
CN106330788B (en) Message fragment transmission method and device
CN106909470A (en) Distributed file system storage method and device based on correcting and eleting codes
CN107291913A (en) HTML webpage loading method and device
CN103336812B (en) Web page resources caching method and device for improving second load efficiency
CN109815432A (en) A kind of method of the method and page static of whole station static
CN105701233B (en) A method of optimization server buffer management
CN107506154A (en) A kind of read method of metadata, device and computer-readable recording medium
CN101251858B (en) Data managing method in multiple page browsers and browsers
CN103455492B (en) A kind of method and apparatus of search and webpage

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20171031

RJ01 Rejection of invention patent application after publication