CN104376122A - Method and server for browser client side to acquire static files - Google Patents

Method and server for browser client side to acquire static files Download PDF

Info

Publication number
CN104376122A
CN104376122A CN201410738886.XA CN201410738886A CN104376122A CN 104376122 A CN104376122 A CN 104376122A CN 201410738886 A CN201410738886 A CN 201410738886A CN 104376122 A CN104376122 A CN 104376122A
Authority
CN
China
Prior art keywords
static file
browser client
server
static
file
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
CN201410738886.XA
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.)
Inspur General Software Co Ltd
Original Assignee
Inspur General Software 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 Inspur General Software Co Ltd filed Critical Inspur General Software Co Ltd
Priority to CN201410738886.XA priority Critical patent/CN104376122A/en
Publication of CN104376122A publication Critical patent/CN104376122A/en
Pending legal-status Critical Current

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/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/113Details of archiving
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/178Techniques for file synchronisation in file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1847File system types specifically adapted to static storage, e.g. adapted to flash memory or SSD

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a server for a browser client side to acquire static files. The method includes S1, receiving a static file request sent by the browser client side by the server, wherein the static file request includes static file identity information; S2, if the circumstance that a first static file corresponding to the identity information exists in a cache of the browser client side is determined by the server, judging whether the first static file is identical with a second static file or not according to the static file request, if yes, executing step 3, and if not, executing step 4, wherein the second static file is a static file corresponding to the identity information in the server; step 3, informing the browser client side to use the first static file by the server, and finishing current process; S4, sending the second static file to the browser client side and informing the browser client side to use the second static file by the server. By the method and the server, the browser client side can timely update the static files.

Description

Browser client obtains method and the server of static file
Technical field
The present invention relates to field of computer technology, particularly relate to method and server that browser client obtains static file.
Background technology
Browser rs cache technology is that the resource can saving network is also accelerated to browse.Browser client stores document requested recently in its buffer memory, and when visitor asks this page again, browser client just can call and show the document stored from buffer memory, so just can accelerate browsing of the page.The buffer memory of browser client can reduce the network bandwidth of Web application, improves access speed, improves the experience of user, can also alleviate the burden of server.
The buffer memory of browser client needs to upgrade, and the content in the content of buffer memory in browser client and server is matched, so that the content of reality matches on the content making user see and server.At present, to the mode that the buffer memory of browser client upgrades be: user manually empties browser rs cache or uses Ctl+F5 refresh page.
Visible, in prior art, user needs manually to perform to empty or refresh operation.But in practice, a lot of user does not understand these operations, or, these operations can not be performed in time.When sending file request with user orientation server, directly expired content may be obtained from the buffer memory of browser client, content actual on the content causing user to see and server is not mated, that is, can not update in the buffer memory of browser client in the content of server update.
Summary of the invention
The invention provides browser client and obtain the method for static file and server, browser client can be made to upgrade in time static file.
First aspect, the invention provides a kind of method that browser client obtains static file, the method comprises:
S1: server receives the static file request that browser client is sent, and wherein, has static file identification information in described static file request;
S2: if there is first static file corresponding with described identification information in the buffer memory of described server determination browser client, then judge that whether the first static file is identical with the second static file according to described static file request, if, then perform step S3, otherwise, perform step S4, wherein, described second static file is static file corresponding with described identification information in described server;
S3: described server notice browser client uses described first static file, terminates current process;
S4: described second static file is sent to described browser client by described server, and notify that browser client uses described second static file.
Further, the method comprises further: preserve configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
After described step S1, before described step S2, also comprise:
Described server judges whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, if so, then performs step S2.
Second aspect, the invention provides a kind of method that browser client obtains static file, comprising:
A1: server receives the static file request that browser client is sent, and wherein, has static file identification information in described static file request;
A2: if described server determines there is If-None-Match information in described static file request, then judge according to described static file request that whether the entity value ETag of the requested variable of the first static file is identical with the ETag of the second static file, if, then perform steps A 3, otherwise, perform steps A 4, wherein, described first static file is static file corresponding with described identification information in the buffer memory of browser client, and described second static file is static file corresponding with described identification information in described server;
A3: described server notice browser client uses described first static file, terminates current process;
A4: described second static file is sent to described browser client by described server, and notify that browser client uses described second static file.
Further, the method comprises further: preserve configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
After described steps A 1, before described steps A 2, also comprise:
Described server judges whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, if so, then performs steps A 2.
Further, the ETag of described first static file comprises the MD5 of described first static file, and the ETag of described second static file comprises the MD5 of described second static file;
Or the ETag of described first static file comprises the cryptographic hash of described first static file, the ETag of described second static file comprises the cryptographic hash of described second static file.
Further, in steps A 3, described server notice browser client uses described first static file to comprise: described server sends 304 status codes to described browser client.
The third aspect, the invention provides a kind of server, and this server comprises:
First receiving element, for receiving the static file request that browser client is sent, wherein, has static file identification information in described static file request;
First judging unit, if for determine browser client buffer memory in there is first static file corresponding with described identification information, then judge that whether the first static file is identical with the second static file according to described static file request, when judged result is for being, notify the first notification unit, when judged result is no, notify the first transmitting element, wherein, described second static file is static file corresponding with described identification information in described server;
Described first notification unit, for when receiving notice, notice browser client uses described first static file;
Described first transmitting element, for when receiving notice, sends to described browser client by described second static file, and notifies that browser client uses described second static file.
Further, described server comprises further: the first storage unit, for preserving configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
Described server, also comprises: the second judging unit, for judging whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, when judged result is for being, notifies described first judging unit.
Fourth aspect, the invention provides a kind of server, comprising:
Second receiving element, for receiving the static file request that browser client is sent, wherein, has static file identification information in described static file request;
3rd judging unit, if for determining there is If-None-Match information in described static file request, then judge according to described static file request that whether the entity value ETag of the requested variable of the first static file is identical with the ETag of the second static file, when judged result is for being, notify the second notification unit, when judged result is no, notify the second transmitting element, wherein, described first static file is static file corresponding with described identification information in the buffer memory of browser client, described second static file is static file corresponding with described identification information in described server,
Described second notification unit, for when receiving notice, notice browser client uses described first static file;
Described second transmitting element, for when receiving notice, sends to described browser client by described second static file, and notifies that browser client uses described second static file.
Further, described server comprises further: the second storage unit, for preserving configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
Described server, also comprises: the 4th judging unit, for judging whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, when judged result is for being, notifies described 3rd judging unit;
And/or described second notification unit, specifically for sending 304 status codes to described browser client.
Method and the server of static file is obtained by browser client provided by the invention, static file in the buffer memory of browser client is pressed from both sides with the corresponding static file in server and compares, thus determine in the buffer memory of browser client, whether static file is up-to-date static file, if the static file in browser client is up-to-date static file, then directly use this static file, if not, then use static file corresponding in server, thus ensure that the static file that static file in browser client is corresponding with server matches, browser client can be upgraded in time static file.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the process flow diagram of the method for a kind of browser client acquisition static file that one embodiment of the invention provides.
Fig. 2 is the process flow diagram of the method for the another kind of browser client acquisition static file that one embodiment of the invention provides.
Fig. 3 is the process flow diagram of the method for another browser client acquisition static file that one embodiment of the invention provides.
Fig. 4 is the process flow diagram of the method for another browser client acquisition static file that one embodiment of the invention provides.
Fig. 5 is the structural representation of a kind of server that one embodiment of the invention provides.
Fig. 6 is the structural representation of the another kind of server that one embodiment of the invention provides.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly; below in conjunction with the accompanying drawing in the embodiment of the present invention; technical scheme in the embodiment of the present invention is clearly and completely described; obviously; described embodiment is the present invention's part embodiment, instead of whole embodiments, based on the embodiment in the present invention; the every other embodiment that those of ordinary skill in the art obtain under the prerequisite not making creative work, all belongs to the scope of protection of the invention.
Embodiments provide a kind of method that browser client obtains static file, see Fig. 1, the method comprises:
S1: server receives the static file request that browser client is sent, and wherein, has the identification information of requested static file in described static file request.
S2: if there is first static file corresponding with described identification information in the buffer memory of described server determination browser client, then judge that whether the first static file is identical with the second static file according to described static file request, if, then perform step S3, otherwise, perform step S4, wherein, described second static file is static file corresponding with described identification information in described server.
S3: described server notice browser client uses described first static file, terminates current process.
S4: described second static file is sent to described browser client by described server, and notify that browser client uses described second static file.
A kind of browser client provided by the embodiment of the present invention obtains the method for static file, static file in the buffer memory of browser client is pressed from both sides with the corresponding static file in server and compares, thus determine in the buffer memory of browser client, whether static file is up-to-date static file, if the static file in browser client is up-to-date static file, then directly use this static file, if not, then use static file corresponding in server, thus ensure that the static file that static file in browser client is corresponding with server matches, browser client can be upgraded in time static file.
Above-mentioned embodiment is the situation of the static file having identification information corresponding in the buffer memory for browser client, for the situation of the static file not having identification information corresponding in the buffer memory of browser client, present embodiments provide a kind of implementation: after described step S1, before described step S2, also comprise: described server judges whether there is described first static file in the buffer memory of browser client according to described static file request, if, then perform step S2, otherwise, perform step S4.
In this implementation, the judgement of the first static file whether is had: described server judges whether there is described first static file in the buffer memory of browser client, comprising according to described static file request in the buffer memory that server can realize browser client by If-None-Match information:
Described server judges whether there is If-None-Match information in described static file request, if had, then determine in the buffer memory of browser client, have described first static file, otherwise, determine in the buffer memory of browser client, there is no described first static file.
For example, this static file request is http(HTTP-Hypertext Transfer Protocol, HTTP) request, whether there is IF-None-Match information to judge whether be cached requested static file in the buffer memory of browser client by the head that judges http request.If there is no IF-None-Match information, then judge not to be cached requested static file in buffer memory.Server arranges the ETag(Entity Tag of requested static file when returning requested static file, the entity value of requested variable).
Because the static file of server process is too much, server performance can be made to reduce, and be not the renewal that each static file needs promptly and accurately, in order to the performance of server can not be made lower, can ensure that again the static file needing to upgrade in time obtains renewal promptly and accurately, in a kind of possible implementation, the static file of the method adopting the present embodiment to provide is set by a configuration file.In a kind of possible implementation, the method also comprises: preserve configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
After described step S1, before described step S2, also comprise:
Described server judges whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, if so, then performs step S2.
Wherein, this configuration file can be preserved in the server, and also can be kept in a memory storage, server can obtain this configuration file from this memory storage.
When judged result is no, can process in the following ways: the handling procedure of Server Default can be adopted to process.For example, when judged result is no, step S4 is performed; Or, when judged result is no, perform step S3; Or, when judged result is no, adopt the handling procedure of Server Default to process.
For example, in configuration file, save the identification information of static file, by search in configuration file whether have the identification information carried in static file request to judge the method whether requested static file adopts the present embodiment to provide processes.Static file corresponding to the information of the static file in configuration file can be the static file needing to upgrade in time.
When static file not corresponding with described identification information in the buffer memory at browser client, or, when static file corresponding in the static file corresponding from described identification information in buffer memory with server is different, in order to make to preserve up-to-date static file in buffer memory, and upper once ask time from buffer memory, directly can obtain static file, in a kind of possible implementation, describedly also to comprise after step s4: described server notifies that static file corresponding for the described identification information stored in the buffer memory of described browser client is updated to described second static file by described browser client.
Due to the corresponding unique ETag of each static file, therefore can determine that whether static file is identical by judging that whether ETag is identical.In a kind of possible implementation, in step S2, according to described static file request, described server judges that whether the first static file is identical with the second static file, comprise: according to described static file request, described server judges that whether the ETag of described first static file is identical with the ETag of described second static file, if, then determine that described first static file is identical with described second static file, otherwise, determine that described first static file is not identical with described second static file.Wherein, the ETag of described first static file is the MD5(Message Digest Algorithm 5 of described first static file, Message Digest Algorithm 5), the ETag of described second static file is the MD5 of described second static file; Or the ETag of described first static file is the cryptographic hash of described first static file, the ETag of described second static file is the cryptographic hash of described second static file.
In a kind of possible implementation, can realize step S3 by 304 status codes, described S3 comprises: described server sends 304 status codes to described browser client.
Browser client it should be noted that: when will open a webpage, browser client needs to the static file required for this webpage of server request, namely static file request is sent to server, wherein, static file comprises: script file, picture, CSS(Cascading Style Sheet, CSS (cascading style sheet)) etc.In order to the static file making server determination browser client ask, carry the identification information of the static file of asking to some extent in static file request, server can determine by this identification information the static file that browser client is asked.For example, this identification information is the title of static file, or preserve default identification information and the mapping table of static file in server, server can determine by searching mapping table the static file that browser client is asked.
In step s3, can whether version unanimously determine that whether two static files are identical with the static file in server by judging in buffer memory static file, namely can by judging the first static file and the second static file whether version be consistent to realize.
A kind of browser client described the embodiment of the present invention in detail provide below by a concrete implementation obtains the method for static file, and see Fig. 2, the method comprises:
Step 201: server receives the static file request that browser client is sent, and wherein, has the identification information of requested static file in described static file request.
Step 202: described server judges whether there is the first static file in the buffer memory of browser client according to described static file request, if, then perform step 203, otherwise, perform step 206, wherein, described first static file is static file corresponding with described identification information in the buffer memory of browser client.
Step 203: described server judges whether there is the information with the static file corresponding to described identification information in the configuration file pre-set according to described static file request, if, then perform step 204, otherwise, perform step 205, wherein, described configuration file comprises more than one by the information upgrading the static file controlled.
Step 204: according to described static file request, described server judges that whether the first static file is identical with the second static file, if, then perform step 205, otherwise, perform step 206, wherein, described second static file is static file corresponding with described identification information in described server.
Step 205: described server notice browser client uses described first static file.
Step 206: described second static file is sent to described browser client by described server, and notify that browser client uses described second static file.
Fig. 3 shows another kind of browser client and obtains the method for static file, in the method using http request as static file request, the method comprises:
Step 301: server receives the http request that browser client is sent, and wherein, has the identification information of requested static file in described http request.
Step 302: described server judges whether there is If-None-Match information in described http request, if so, then performs step 303, otherwise, perform step 306.
A kind of codes implement mode of this step is:
Request.Headers.GetValues("If-None-Match")
Step 303: described server judges whether there is the information with the static file corresponding to described identification information in the configuration file pre-set according to described static file request, if, then perform step 304, otherwise, perform step 305, wherein, described configuration file comprises more than one by the information upgrading the static file controlled.
Step 304: according to described static file request, described server judges that whether the ETag of described first static file is identical with the ETag of described second static file, if, then perform step 305, otherwise, perform step 306, wherein, described first static file is static file corresponding with described identification information in the buffer memory of browser client, and described second static file is static file corresponding with described identification information in described server.
Step 305: described server sends 304 status codes to described browser client, to notify that browser client uses described first static file.
A kind of codes implement mode of this step is:
context.Response.StatusCode = 304;
context.Response.StatusDescription = "Not Modified";
context.Response.SuppressContent = true;
context.Response.AddHeader("Content-Length", "0");
context.Response.End()。
Step 306: described second static file is sent to described browser client by described server, and notify that browser client uses described second static file.
When performing this step 306, If-None-Match information is not had in static file request, that is browser client asks this file at first time, while described second static file is sent to described browser client by server, the ETag of this second static file can be set further, the MD5 of file or cryptographic hash can be got as ETag.Wherein, a kind of codes implement mode is:
context.Response.Cache.SetAllowResponseInBrowserHistory(true);
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetETag(serEtag)。
The embodiment of the present invention additionally provides a kind of method that browser client obtains static file, and see Fig. 4, the method comprises:
A1: server receives the static file request that browser client is sent, and wherein, has static file identification information in described static file request;
A2: if described server determines there is If-None-Match information in described static file request, then judge that whether the ETag of the first static file is identical with the ETag of the second static file according to described static file request, if, then perform steps A 3, otherwise, perform steps A 4, wherein, described first static file is static file corresponding with described identification information in the buffer memory of browser client, and described second static file is static file corresponding with described identification information in described server;
A3: described server notice browser client uses described first static file, terminates current process;
A4: described second static file is sent to described browser client by described server, and notify that browser client uses described second static file.
In a kind of possible implementation, the method, comprises further: preserve configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
After described steps A 1, before described steps A 2, also comprise:
Described server judges whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, if so, then performs steps A 2.
When judged result is no, can process in the following ways: for example, when judged result is no, perform step S4; Or, when judged result is no, perform step S3; Or, when judged result is no, adopt the handling procedure of Server Default to process.
In a kind of possible implementation, in steps A 3, described server notice browser client uses described first static file to comprise: described server sends 304 status codes to described browser client.
In this enforcement, the ETag of described first static file comprises the MD5 of described first static file, and the ETag of described second static file comprises the MD5 of described second static file;
Or the ETag of described first static file comprises the cryptographic hash of described first static file, the ETag of described second static file comprises the cryptographic hash of described second static file.
The embodiment of the present invention additionally provides a kind of server, and see Fig. 5, this server comprises:
First receiving element 501, for receiving the static file request that browser client is sent, wherein, has static file identification information in described static file request;
First judging unit 502, if for determine browser client buffer memory in there is first static file corresponding with described identification information, then judge that whether the first static file is identical with the second static file according to described static file request, when judged result is for being, notify the first notification unit 503, when judged result is no, notify the first transmitting element 504, wherein, described second static file is static file corresponding with described identification information in described server;
Described first notification unit 503, for when receiving notice, notice browser client uses described first static file;
Described first transmitting element 504, for when receiving notice, sends to described browser client by described second static file, and notifies that browser client uses described second static file.
Described server comprises further: the first storage unit, for preserving configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
In a kind of possible implementation, described server, also comprises: the second judging unit, for judging whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, when judged result is for being, notify described first judging unit.
In a kind of possible implementation, described second judging unit can also be further used for judging whether there is described first static file in the buffer memory of browser client according to described static file request, when judged result is for being, notify described first judging unit 502, when judged result is no, notify described first transmitting element 504.
In a kind of possible implementation, described server also comprises, update notification unit;
Described first transmitting element 504, also for notifying described update notification unit;
Described update notification unit, for when receiving notice, notifies that static file corresponding for the described identification information stored in the buffer memory of described browser client is updated to described second static file by described browser client.
In a kind of possible implementation, described second judging unit, specifically for judging whether there is If-None-Match information in described static file request, when judged result is for being, then determine in the buffer memory of browser client, have described first static file, when judged result is no, then determine in the buffer memory of browser client, there is no described first static file.
In a kind of possible implementation, described first judging unit 502, specifically for judging that according to described static file request whether the ETag of described first static file is identical with the ETag of described second static file, when judged result is for being, then determine that described first static file is identical with described second static file, when judged result is no, then determine that described first static file is not identical with described second static file.
Wherein, the ETag of described first static file is the MD5 of described first static file, and the ETag of described second static file is the MD5 of described second static file; Or the ETag of described first static file is the cryptographic hash of described first static file, the ETag of described second static file is the cryptographic hash of described second static file.
In a kind of possible implementation, described first notification unit 503, specifically for sending 304 status codes to described browser client.
See Fig. 5, the embodiment of the present invention additionally provides a kind of server, and this server comprises:
Second receiving element 601, for receiving the static file request that browser client is sent, wherein, has static file identification information in described static file request;
3rd judging unit 602, if for determining there is If-None-Match information in described static file request, then judge according to described static file request that whether the entity value ETag of the requested variable of the first static file is identical with the ETag of the second static file, when judged result is for being, notify the second notification unit 603, when judged result is no, notify the second transmitting element 604, wherein, described first static file is static file corresponding with described identification information in the buffer memory of browser client, described second static file is static file corresponding with described identification information in described server,
Described second notification unit 603, for when receiving notice, notice browser client uses described first static file;
Described second transmitting element 604, for when receiving notice, sends to described browser client by described second static file, and notifies that browser client uses described second static file.
In a kind of possible implementation, described server comprises further: the second storage unit, for preserving configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
Described server, also comprises: the 4th judging unit, for judging whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, when judged result is for being, notifies described 3rd judging unit 602;
In a kind of possible implementation, described second notification unit 603, specifically for sending 304 status codes to described browser client.
In addition, the present embodiment additionally provides a kind of static file administrative unit, and this static file administrative unit generates above-mentioned configuration file for receiving outside instruction.For being arranged the static file needing to upgrade in time by this static file administrative unit, the information of the static file that user is arranged is saved in configuration file by static file administrative unit.
The content such as information interaction, implementation between each unit in the said equipment, due to the inventive method embodiment based on same design, particular content can see in the inventive method embodiment describe, repeat no more herein.
Each embodiment can realize under ASP.NET environment above, also can realize in other way.
The browser client that the embodiment of the present invention provides obtains method and the server of static file, has following beneficial effect:
1, present embodiments provide method and server that browser client obtains static file, the browser client provided by the embodiment of the present invention obtains the method for static file, static file in the buffer memory of browser client is pressed from both sides with the corresponding static file in server and compares, thus determine in the buffer memory of browser client, whether static file is up-to-date static file, if the static file in browser client is up-to-date static file, then directly use this static file, if not, then use static file corresponding in server, thus ensure that the static file that static file in browser client is corresponding with server matches, browser client can be upgraded in time static file,
2, present embodiments provide browser client and obtain the method for static file and server, the buffer memory characteristic namely by browser client improves Consumer's Experience, again can Deterministic service device upgrade after static file be updated to timely in browser client.
It should be noted that, in this article, the relational terms of such as first and second and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element " being comprised " limited by statement, and be not precluded within process, method, article or the equipment comprising described key element and also there is other same factor.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that programmed instruction is relevant, aforesaid program can be stored in the storage medium of embodied on computer readable, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium in.
Finally it should be noted that: the foregoing is only preferred embodiment of the present invention, only for illustration of technical scheme of the present invention, be not intended to limit protection scope of the present invention.All any amendments done within the spirit and principles in the present invention, equivalent replacement, improvement etc., be all included in protection scope of the present invention.

Claims (10)

1. browser client obtains a method for static file, and it is characterized in that, the method comprises:
S1: server receives the static file request that browser client is sent, and wherein, has static file identification information in described static file request;
S2: if there is first static file corresponding with described identification information in the buffer memory of described server determination browser client, then judge that whether the first static file is identical with the second static file according to described static file request, if, then perform step S3, otherwise, perform step S4, wherein, described second static file is static file corresponding with described identification information in described server;
S3: described server notice browser client uses described first static file, terminates current process;
S4: described second static file is sent to described browser client by described server, and notify that browser client uses described second static file.
2. method according to claim 1, is characterized in that, comprises further: preserve configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
After described step S1, before described step S2, also comprise:
Described server judges whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, if so, then performs step S2.
3. browser client obtains a method for static file, it is characterized in that, comprising:
A1: server receives the static file request that browser client is sent, and wherein, has static file identification information in described static file request;
A2: if described server determines there is If-None-Match information in described static file request, then judge according to described static file request that whether the entity value ETag of the requested variable of the first static file is identical with the ETag of the second static file, if, then perform steps A 3, otherwise, perform steps A 4, wherein, described first static file is static file corresponding with described identification information in the buffer memory of browser client, and described second static file is static file corresponding with described identification information in described server;
A3: described server notice browser client uses described first static file, terminates current process;
A4: described second static file is sent to described browser client by described server, and notify that browser client uses described second static file.
4. method according to claim 3, is characterized in that, comprises further: preserve configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
After described steps A 1, before described steps A 2, also comprise:
Described server judges whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, if so, then performs steps A 2.
5. method according to claim 3, is characterized in that, the ETag of described first static file comprises the MD5 of described first static file, and the ETag of described second static file comprises the MD5 of described second static file;
Or the ETag of described first static file comprises the cryptographic hash of described first static file, the ETag of described second static file comprises the cryptographic hash of described second static file.
6. method according to claim 1, is characterized in that, in steps A 3, described server notice browser client uses described first static file to comprise: described server sends 304 status codes to described browser client.
7. a server, is characterized in that, this server comprises:
First receiving element, for receiving the static file request that browser client is sent, wherein, has static file identification information in described static file request;
First judging unit, if for determine browser client buffer memory in there is first static file corresponding with described identification information, then judge that whether the first static file is identical with the second static file according to described static file request, when judged result is for being, notify the first notification unit, when judged result is no, notify the first transmitting element, wherein, described second static file is static file corresponding with described identification information in described server;
Described first notification unit, for when receiving notice, notice browser client uses described first static file;
Described first transmitting element, for when receiving notice, sends to described browser client by described second static file, and notifies that browser client uses described second static file.
8. server according to claim 7, is characterized in that, described server comprises further: the first storage unit, for preserving configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
Described server, also comprises: the second judging unit, for judging whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, when judged result is for being, notifies described first judging unit.
9. a server, is characterized in that, comprising:
Second receiving element, for receiving the static file request that browser client is sent, wherein, has static file identification information in described static file request;
3rd judging unit, if for determining there is If-None-Match information in described static file request, then judge according to described static file request that whether the entity value ETag of the requested variable of the first static file is identical with the ETag of the second static file, when judged result is for being, notify the second notification unit, when judged result is no, notify the second transmitting element, wherein, described first static file is static file corresponding with described identification information in the buffer memory of browser client, described second static file is static file corresponding with described identification information in described server,
Described second notification unit, for when receiving notice, notice browser client uses described first static file;
Described second transmitting element, for when receiving notice, sends to described browser client by described second static file, and notifies that browser client uses described second static file.
10. server according to claim 9, is characterized in that, described server comprises further: the second storage unit, for preserving configuration file, comprises more than one by the information upgrading the static file controlled at this configuration file;
Described server, also comprises: the 4th judging unit, for judging whether there is the information with the static file corresponding to described identification information in described configuration file according to described static file request, when judged result is for being, notifies described 3rd judging unit;
And/or described second notification unit, specifically for sending 304 status codes to described browser client.
CN201410738886.XA 2014-12-08 2014-12-08 Method and server for browser client side to acquire static files Pending CN104376122A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410738886.XA CN104376122A (en) 2014-12-08 2014-12-08 Method and server for browser client side to acquire static files

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410738886.XA CN104376122A (en) 2014-12-08 2014-12-08 Method and server for browser client side to acquire static files

Publications (1)

Publication Number Publication Date
CN104376122A true CN104376122A (en) 2015-02-25

Family

ID=52555029

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410738886.XA Pending CN104376122A (en) 2014-12-08 2014-12-08 Method and server for browser client side to acquire static files

Country Status (1)

Country Link
CN (1) CN104376122A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017028688A1 (en) * 2015-08-14 2017-02-23 阿里巴巴集团控股有限公司 Method, device and system for reading and writing files
CN107315791A (en) * 2017-06-14 2017-11-03 广州酷狗计算机科技有限公司 Static resource caching method, device and computer-readable recording medium
CN107463508A (en) * 2017-07-19 2017-12-12 北京微影时代科技有限公司 Script caching sweep-out method, device, electronic equipment and storage medium
CN107704465A (en) * 2016-08-08 2018-02-16 腾讯科技(深圳)有限公司 Static resource update method and static resource management system
CN107908634A (en) * 2017-08-29 2018-04-13 上海壹账通金融科技有限公司 The buffer control method and mobile terminal of browser
CN108241689A (en) * 2016-12-26 2018-07-03 广州市动景计算机科技有限公司 Page resource acquisition methods, device and client device
TWI671639B (en) * 2017-12-21 2019-09-11 林勁璋 Resource management system and management method thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080162817A1 (en) * 2006-12-29 2008-07-03 Yusuf Batterywala Method and system for caching metadata of a storage system
CN102109989A (en) * 2009-12-29 2011-06-29 阿里巴巴集团控股有限公司 Method, device and system for controlling browser cache

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080162817A1 (en) * 2006-12-29 2008-07-03 Yusuf Batterywala Method and system for caching metadata of a storage system
CN102109989A (en) * 2009-12-29 2011-06-29 阿里巴巴集团控股有限公司 Method, device and system for controlling browser cache

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ERIC LAWRENCE: ""Understanding HTTP/304 Responses"", 《HTTP://WWW.TELERIK.COM/BLOGS/UNDERSTANDING-HTTP-304-RESPONSES》 *
风隼: ""关于Etag/If-None-Match的用法"", 《HTTP://BLOG.CSDN.NET/KEKE0307/ARTICLE/DETAILS/7414170》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017028688A1 (en) * 2015-08-14 2017-02-23 阿里巴巴集团控股有限公司 Method, device and system for reading and writing files
CN106469150A (en) * 2015-08-14 2017-03-01 阿里巴巴集团控股有限公司 File read/write method, device and system
US10338917B2 (en) 2015-08-14 2019-07-02 Alibaba Group Holding Limited Method, apparatus, and system for reading and writing files
CN106469150B (en) * 2015-08-14 2019-10-08 阿里巴巴集团控股有限公司 File read/write method, device and system
CN107704465A (en) * 2016-08-08 2018-02-16 腾讯科技(深圳)有限公司 Static resource update method and static resource management system
CN107704465B (en) * 2016-08-08 2021-11-16 腾讯科技(深圳)有限公司 Static resource updating method and static resource management system
CN108241689A (en) * 2016-12-26 2018-07-03 广州市动景计算机科技有限公司 Page resource acquisition methods, device and client device
CN107315791A (en) * 2017-06-14 2017-11-03 广州酷狗计算机科技有限公司 Static resource caching method, device and computer-readable recording medium
CN107463508A (en) * 2017-07-19 2017-12-12 北京微影时代科技有限公司 Script caching sweep-out method, device, electronic equipment and storage medium
CN107908634A (en) * 2017-08-29 2018-04-13 上海壹账通金融科技有限公司 The buffer control method and mobile terminal of browser
TWI671639B (en) * 2017-12-21 2019-09-11 林勁璋 Resource management system and management method thereof

Similar Documents

Publication Publication Date Title
CN104376122A (en) Method and server for browser client side to acquire static files
JP6629697B2 (en) Method and apparatus for extracting a virtual machine image file
US10380103B2 (en) Object data updating method and apparatus in an object storage system
US20170171295A1 (en) File upload and download methods and associated server
WO2016026384A1 (en) Client page display method, device and system
CN107329963B (en) Method and device for accelerating webpage access
CN102882974B (en) Method for saving website access resource by website identification version number
CN106446174A (en) Method for page loading in application
CN105681380B (en) Client off-line method and its system
US9471896B2 (en) Memo synchronization system, mobile system, and method for synchronizing memo data
CN104077310A (en) Method, equipment and system for loading resource file
CN106817391A (en) Document breakpoint transmission method and apparatus
CN104683329A (en) Data caching method and system for mobile equipment client
CN102752371A (en) Method for achieving splash on client side and client side
CN104462283A (en) Method, device and client for requesting webpage elements in mobile terminal
US10938773B2 (en) Method and apparatus for synchronizing contact information and medium
JP2005530258A (en) System and method for resynchronization while refreshing a client device from a server
CN108183960A (en) File updating method, server, storage medium and device based on CDN
US20150113093A1 (en) Application-aware browser
KR101666064B1 (en) Apparatus for managing data by using url information in a distributed file system and method thereof
CN110741617A (en) Resource updating method and device, computer equipment and storage medium
CN110096295B (en) Multi-module mobile application thermal updating method and system based on reactivating
CN104717286B (en) Data processing method, terminal, server and system
WO2022105631A1 (en) Method and apparatus for requesting configuration page, and electronic device
CN107391132B (en) Method, device and equipment for target App to execute preset action

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150225

WD01 Invention patent application deemed withdrawn after publication