CN110727889A - Static webpage resource loading method, device, medium and electronic equipment - Google Patents

Static webpage resource loading method, device, medium and electronic equipment Download PDF

Info

Publication number
CN110727889A
CN110727889A CN201810691210.8A CN201810691210A CN110727889A CN 110727889 A CN110727889 A CN 110727889A CN 201810691210 A CN201810691210 A CN 201810691210A CN 110727889 A CN110727889 A CN 110727889A
Authority
CN
China
Prior art keywords
file
directory
picture
static
files
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
CN201810691210.8A
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 Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
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 Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810691210.8A priority Critical patent/CN110727889A/en
Publication of CN110727889A publication Critical patent/CN110727889A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the invention provides a method, a device, a medium and electronic equipment for loading static webpage resources, wherein the method comprises the following steps: moving a first file and a second file under the static webpage resource directory to the first directory; adding signature information to the file name of the picture file in the static webpage resource file directory, and moving to a second directory; updating the reference relation of the reference picture files of the first file and the second file in the first directory based on the file names of the picture files in the second directory; updating a third file in the static webpage resource directory based on the first file and the second file in the updated first directory; and packaging the updated third file, the first directory and the second directory to realize the loading of the static webpage resources. According to the technical scheme of the embodiment of the invention, the recently modified resource files can be selectively loaded, so that network requests are reduced, the loading speed is effectively increased, and better service experience is increased.

Description

Static webpage resource loading method, device, medium and electronic equipment
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device, a medium and electronic equipment for loading static webpage resources.
Background
At present, the demand of nesting html5 in a mobile App is more and more, and therefore, higher requirements are placed on the rendering speed and the user experience of html5 pages.
In the existing technical solution, the way of referring to static resources in html pages is mainly: and uniformly adding a timestamp behind the url of the static resources such as js and css to realize the real-time reference of the newly issued resource file.
However, this solution has the following drawbacks:
(1) when the resource files are issued, the timestamps of all the resource files are updated in batches, and the html page needs to reload the corresponding resources due to the update of the timestamps of the unmodified files, so that the bandwidth waste is caused;
(2) the browser can be effectively prompted to use the cache or read the static resources of the server by a timestamp mode, but a resource server cannot sense the static resources, and the request of the static resource file is from a newly effective html or an html page which is not updated; in the gap between the issue of the html code at the front end and the issue of the static resource file, the case that the html code is not matched with the static resource file is likely to occur: if the html code is loaded when the user accesses the html page, when the js code is requested, the new resource file is just met and the server takes effect, and at the moment, the old html page is loaded with the new js code and other codes, and an exception on display or function occurs.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present invention and therefore may include information that does not constitute prior art known to a person of ordinary skill in the art.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a medium, and an electronic device for loading static web page resources, so as to overcome one or more problems of easy error and low performance in updating a static html page due to limitations and defects of related technologies, at least to a certain extent.
Additional features and advantages of embodiments of the invention will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the invention.
According to a first aspect of the embodiments of the present invention, a method for loading static webpage resources is provided, which includes:
moving a first file and a second file under the static webpage resource directory to the first directory;
adding signature information to the filename of the picture file in the static webpage resource file directory, and moving to a second directory;
updating the reference relation of the reference picture files of the first file and the second file in the first directory based on the file names of the picture files in the second directory;
updating a third file in the static webpage resource directory based on the updated first file and the updated second file in the first directory;
and packaging the updated third file, the first directory and the second directory to realize the loading of the static webpage resources.
According to an embodiment of the present invention, based on the foregoing solution, after adding signature information to the filename of the picture file in the static web resource file directory and moving to the second directory, the method further includes:
and when detecting that a new picture file is added into the second directory, cleaning the picture files with the same file name in the second directory, and reserving a preset number of picture files in a preset time period.
According to an embodiment of the present invention, based on the foregoing solution, the updating, based on the filename of the picture file in the second directory, the reference relationship between the reference picture files of the first file and the second file in the first directory includes:
traversing a first file and a second file under the first directory to determine a reference relation of the first file and the second file to reference the picture file;
replacing the file name of the first file in the first directory and the reference relation of the second file with the file name of the picture file referenced in the second directory;
signature information is added to the file name of the first file and the file name of the second file after the file name is replaced.
According to an embodiment of the present invention, based on the foregoing solution, after the above updating the reference relationship between the reference picture files of the first file and the second file in the first directory, the method further includes:
and cleaning the updated files with the same file name in the second directory, and reserving a preset number of first files and second files in a preset time period.
According to an embodiment of the present invention, based on the foregoing solution, the updating, based on the updated first file and the updated second file in the first directory, a third file in the static web resource directory includes:
and updating the reference relation between the first file and the second file referred by the third file in the static webpage resource directory into the first file and the second file referred by the first directory.
According to a second aspect of the embodiments of the present invention, there is provided a device for loading static web page resources, including: the system comprises a first moving module, a second moving module, a first updating module, a second updating module and a packaging module; wherein the content of the first and second substances,
the first moving module is used for moving a first file and a second file under the static webpage resource directory to the first directory;
the second mobile module is used for adding signature information to the filename of the picture file in the static webpage resource file directory and moving the filename to a second directory;
the first updating module is used for updating the reference relation of the reference picture files of the first file and the second file in the first directory based on the file names of the picture files in the second directory;
the second updating module is used for updating a third file in the static webpage resource directory based on the updated first file and the updated second file in the first directory;
and the packaging module is used for packaging the updated third file, the first directory and the second directory to realize the loading of the static webpage resources.
According to an embodiment of the present invention, based on the foregoing solution, the apparatus further includes:
and the first cleaning module is used for cleaning the picture files with the same file name in the second directory after detecting that new picture files are added in the second directory, and reserving a preset number of picture files in a preset time period.
According to an embodiment of the present invention, based on the foregoing scheme, the first updating module is specifically configured to:
traversing a first file and a second file under the first directory to determine a reference relation of the first file and the second file to reference the picture file;
replacing the file name of the first file in the first directory and the reference relation of the second file with the file name of the picture file referenced in the second directory;
signature information is added to the file name of the first file and the file name of the second file after the file name is replaced.
According to an embodiment of the present invention, based on the foregoing solution, the apparatus further includes:
and the second cleaning module is used for cleaning the updated files with the same file name in the second directory, and reserving a preset number of first files and second files in a preset time period.
According to an embodiment of the present invention, based on the foregoing scheme, the second updating module is specifically configured to:
and updating the reference relation between the first file and the second file referred by the third file in the static webpage resource directory into the first file and the second file referred by the first directory.
According to a third aspect of embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements the method for loading static web resources as in the first aspect of the embodiments described above.
According to a fourth aspect of embodiments of the present invention, there is provided an electronic apparatus, including: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement the method for loading static web resources as described in the first aspect of the embodiments above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the technical solutions provided by some embodiments of the present invention, a first file and a second file in a static webpage resource directory are moved to a first directory; adding signature information to the file name of the picture file in the static webpage resource file directory, and moving to a second directory; updating the reference relation of the reference picture files of the first file and the second file in the first directory based on the file names of the picture files in the second directory; updating a third file in the static webpage resource directory based on the first file and the second file in the updated first directory; and packaging the updated third file, the first directory and the second directory to realize the loading of the static webpage resources. Therefore, the technical scheme of the embodiment of the invention can match the html with the corresponding resource files, the resource server reserves the latest resource files of several versions, the correct resource files can be loaded by simultaneously supporting the html of different versions, and meanwhile, the latest modified resource files can be selectively loaded, so that network requests are reduced, the loading speed is effectively increased, and better service experience is increased.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 is a schematic diagram illustrating a conventional webpage tamper-proofing technique;
fig. 2 schematically shows a flow chart of a client terminal data verification method according to an embodiment of the invention;
fig. 3 schematically shows a flow chart of a server terminal data verification method according to an embodiment of the invention;
fig. 4 schematically shows a structural diagram of a computer system of the electronic device according to an embodiment of the present invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
FIG. 1 schematically shows a flowchart of a method for loading static web page resources according to an embodiment of the invention.
Referring to fig. 1, a method for loading static web page resources according to an embodiment of the present invention includes the following steps:
step S110, moving a first file and a second file under the static webpage resource directory to the first directory;
step S120, signature information is added to the file name of the picture file in the static webpage resource file directory, and the picture file is moved to a second directory;
step S130, updating the reference relation between the first file in the first directory and the reference picture file of the second file based on the file name of the picture file in the second directory;
step S140, updating a third file in the static webpage resource directory based on the first file and the second file in the updated first directory;
and step S150, packaging the updated third file, the first directory and the second directory to realize the loading of the static webpage resources.
The technical scheme of the embodiment shown in fig. 1 can match html with corresponding resource files, and the resource server reserves the latest resource files of several versions, so that it is ensured that html of different versions can be supported simultaneously to be loaded to correct resource files, and meanwhile, the latest modified resource files can be selectively loaded, thereby reducing network requests, effectively improving loading speed, and increasing better service experience.
Implementation details of the various steps shown in FIG. 1 are set forth below:
in step S110, the first file and the second file in the static webpage resource directory are moved to the first directory.
In an embodiment of the present invention, the static webpage resource directory at least includes a webpage picture file, a.js file (corresponding to the first file proposed in the embodiment of the present invention) as a suffix for storing a javascript script, and a.css file (corresponding to the second file proposed in the embodiment of the present invention) as a suffix for controlling a static webpage style and separating style information from static webpage content, and may further include a text, a sound, a FLASH animation, a client script, an ActiveX control, a JAVA applet, and the like.
In one embodiment of the present invention, the first directory may be a folder directory created under the static web resource directory, and the folder directory may be a compressed folder directory in which files of js and files of css are interspersed under the static web resource directory.
In step S120, signature information is added to the filename of the picture file in the static web resource file directory, and the picture file is moved to the second directory.
In an embodiment of the present invention, contents of the web page picture file, the. js file, and the. css file in the static web page resource file directory may be updated, so that in the embodiment of the present invention, MD5 operation is performed on each file in the static web page resource file directory to obtain signature information corresponding to the file, and for files with the same file name, signature information before and after the file is updated is completely different, and the update states of the files such as the web page picture file, the. js file, and the. css file in the static web page resource file directory can be determined by the signature information.
In an embodiment of the present invention, based on the foregoing solution, a script program, for example, node. js, may implement a fast MD5 operation on a file in a static web resource file directory, generate signature information corresponding to the file, and write the signature information into a file name of the file.
In an embodiment of the invention, after detecting that a new picture file is added into the second directory, the picture files with the same file name in the second directory are cleaned, and the preset number of picture files in the preset time period are reserved, so that only a plurality of versions of the picture files in the latest time period are reserved under the second directory, and it is ensured that html of different versions can be simultaneously supported, and correct files can be loaded.
In step S130, the reference relationship between the first file in the first directory and the reference picture file in the second file is updated based on the file name of the picture file in the second directory.
In an embodiment of the invention, based on the foregoing scheme, traversing js files and css files in the first directory to determine a reference relationship between the js files and the css files for referencing the image files; replacing the file name of the js file and the reference relation of the css file in the first directory with the file name of the image file referenced in the second directory; signature information is added to the file name of the js file and the file name of the css file after the file name is replaced.
In an embodiment of the present invention, based on the foregoing solution, it is first necessary to determine the picture files referenced by the js file and the css file, then search for the corresponding picture file in the second directory, and replace the file names of the js file and the css file according to the file names of the searched picture files, so as to ensure that the js file and the css file in the first directory can be referenced to the latest and correct picture file, so that the static web resource can be loaded correctly after being updated.
In step S140, a third file in the static web resource directory is updated based on the first file and the second file in the updated first directory.
In one embodiment of the invention, the reference relationship between the js file and the css file in the static webpage resource directory (corresponding to the third file proposed by the embodiment of the invention) is updated to reference the js file and the css file in the first directory.
In an embodiment of the present invention, based on the foregoing solution, the html file in the static web resource directory may be traversed, references of the js file and the css file in the html file are searched, and the js file and the css file with the latest modification dates in the first directory are replaced.
In step S150, the updated third file, the first directory, and the second directory are packaged to implement loading of the static web page resource.
In an embodiment of the invention, after receiving a request sent by a browser client, a resource server packages an updated html file, a js file and a css file in a first directory and a picture file in a second directory, and sends the packaged files to the browser client in response to the request of the browser client, so that the browser client can load a correct resource file, and the browser client can selectively load a recently modified resource file, thereby reducing network requests, effectively improving the loading speed and increasing better service experience.
The following describes in detail a method for loading static web resources according to an embodiment of the present invention with a specific application embodiment, where the static web resource directory includes: the system comprises an A directory, a B directory, a css folder, a js folder, an image folder and an html file, wherein the A directory corresponds to a first directory, the B directory corresponds to a second directory, the css folder comprises the css file, the js folder comprises the js file, and the image folder comprises the png-format image file.
Fig. 2 schematically shows a flowchart of a loading method for actually applying static web page resources according to an embodiment of the present invention.
Referring to fig. 2, a method for loading a practically applied static web page resource according to an embodiment of the present invention includes the following steps:
step S201, obtaining files in a static webpage resource directory;
in one embodiment of the present invention, the static web page resource directory may be:
/zip/A
/zip/B
/css/xx.css
/js/xx.js
/image/xx.png
/xx.html
wherein xx is a file name, and file names of files with mutual reference relation are the same.
Step S202, merging and compressing the css file and the js file, and moving to the A directory;
step S203, adding an MD5 signature to the file name of the file under the image folder, and moving to the directory B;
the MD5 signature may be 123, and the filename of the picture file after the signature is appended may be xx-123. png.
Step S204, cleaning the files in the directory B, and only reserving 5 version files in the latest time period;
the image files with the same file name in the directory B are cleaned, only 5 version files in the latest time period can be reserved, and the number of the specifically stored files can be set according to actual requirements.
Step S205, traversing the files in the directory A, searching the reference of the picture file, and replacing the picture file with the corresponding picture name with suffix in the directory B;
step S206, adding MD5 signature to the file name of the file in the A directory;
step S207, cleaning the files in the directory A, and only reserving 5 version files in the latest time period;
the css file and the js file with the same file name in the directory A are cleaned, only 5 versions of the css file and the js file in the latest time period can be reserved, and the number of the files to be stored can be set according to actual requirements.
Step S208, traversing the html files under the static webpage resource directory, searching the reference relation of the css file and the js file, and replacing the css file and the js file under the reference A directory;
step S209, obtaining the updated html file, the first directory and the second directory;
the updated static web page resource directory may be:
/zip/A.xx-123.css
/zip/A/xx-234.js
/zip/B/xx-453.png
/css/xx.css
/js/xx,png
/xx.html
and S210, packaging and releasing the zip directory and the corresponding html file, and realizing the loading of the static webpage resource by the browser client according to the packaged file.
The following describes an embodiment of an apparatus of the present invention, which can be used to execute the above-mentioned loading method for static web resources of the present invention.
Fig. 3 schematically shows a block diagram of a loading apparatus of static web page resources according to an embodiment of the present invention.
Referring to fig. 3, an apparatus 300 for loading static web page resources according to an embodiment of the present invention includes: a first moving module 301, a second moving module 302, a first updating module 303, a second updating module 304, and a packing module 305; wherein the content of the first and second substances,
a first moving module 301, configured to move a first file and a second file in a static webpage resource directory to the first directory;
the second moving module 302 is configured to add signature information to a filename of a picture file in the static webpage resource file directory, and move the filename to a second directory;
a first updating module 303, configured to update a reference relationship between a first file in the first directory and a reference picture file in the second file based on a filename of a picture file in the second directory;
a second updating module 304, configured to update a third file in the static web resource directory based on the first file and the second file in the updated first directory;
and a packaging module 305, configured to package the updated third file, the first directory, and the second directory, so as to implement loading of the static webpage resource.
In an embodiment of the present invention, the apparatus further includes:
the first cleaning module 306 is configured to clean the picture files with the same file name in the second directory after detecting that a new picture file is added to the second directory, and reserve a preset number of picture files within a preset time period.
In an embodiment of the present invention, the first updating module 303 is specifically configured to:
traversing a first file and a second file in a first directory to determine a reference relation of the first file and the second file to reference the picture file;
replacing the file name of the first file in the first directory and the reference relation of the second file with the file name of the picture file referenced in the second directory;
signature information is added to the file name of the first file and the file name of the second file after the file name is replaced.
In an embodiment of the present invention, the apparatus further includes:
the second cleaning module 307 is configured to clean the files with the same file name in the updated second directory, and reserve a preset number of the first files and the second files in a preset time period.
In an embodiment of the present invention, the second updating module 304 is specifically configured to:
and updating the reference relation between the first file and the second file referred by the third file in the static webpage resource directory into the first file and the second file referred by the first directory.
For details that are not disclosed in the embodiments of the apparatus of the present invention, please refer to the above embodiments of the method for loading static webpage resources of the present invention for the details that are not disclosed in the embodiments of the apparatus of the present invention.
Referring now to FIG. 4, a block diagram of a computer system 400 suitable for use with the electronic device implementing an embodiment of the invention is shown. The computer system 400 of the electronic device shown in fig. 4 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for system operation are also stored. The CPU401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 1206 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411. The above-described functions defined in the system of the present application are executed when the computer program is executed by a Central Processing Unit (CPU) 401.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which when executed by the electronic device, cause the electronic device to implement the terminal data verification method in the above embodiment.
For example, the electronic device described above may implement as shown in fig. 1: step S110, moving a first file and a second file under the static webpage resource directory to the first directory; step S120, signature information is added to the file name of the picture file in the static webpage resource file directory, and the picture file is moved to a second directory; step S130, updating the reference relation between the first file in the first directory and the reference picture file of the second file based on the file name of the picture file in the second directory; step S140, updating a third file in the static webpage resource directory based on the first file and the second file in the updated first directory; and step S150, packaging the updated third file, the first directory and the second directory to realize the loading of the static webpage resources.
As another example, the electronic device described above may implement the steps shown in fig. 2.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (12)

1. A method for loading static webpage resources is characterized by comprising the following steps:
moving a first file and a second file under the static webpage resource directory to the first directory;
adding signature information to the filename of the picture file in the static webpage resource file directory, and moving to a second directory;
updating the reference relation of the reference picture files of the first file and the second file in the first directory based on the file names of the picture files in the second directory;
updating a third file in the static webpage resource directory based on the updated first file and the updated second file in the first directory;
and packaging the updated third file, the first directory and the second directory to realize the loading of the static webpage resources.
2. The method for loading the static webpage resource according to claim 1, wherein after adding signature information to the filename of the picture file in the static webpage resource file directory and moving to the second directory, the method further comprises:
and when detecting that a new picture file is added into the second directory, cleaning the picture files with the same file name in the second directory, and reserving a preset number of picture files in a preset time period.
3. The method for loading the static webpage resource according to claim 1, wherein the updating the reference relationship between the first file and the reference picture file of the second file in the first directory based on the file name of the picture file in the second directory comprises:
traversing a first file and a second file under the first directory to determine a reference relation of the first file and the second file to reference the picture file;
replacing the file name of the first file in the first directory and the reference relation of the second file with the file name of the picture file referenced in the second directory;
signature information is added to the file name of the first file and the file name of the second file after the file name is replaced.
4. The method for loading the static page resource according to claim 1, wherein after the updating of the reference relationship between the reference picture files of the first file and the second file in the first directory, the method further comprises:
and cleaning the updated files with the same file name in the second directory, and reserving a preset number of first files and second files in a preset time period.
5. The method for loading the static web resource according to claim 1, wherein the updating the third file in the static web resource directory based on the updated first file and the updated second file in the first directory comprises:
and updating the reference relation between the first file and the second file referred by the third file in the static webpage resource directory into the first file and the second file referred by the first directory.
6. A loading device for static webpage resources is characterized by comprising: the system comprises a first moving module, a second moving module, a first updating module, a second updating module and a packaging module; wherein the content of the first and second substances,
the first moving module is used for moving a first file and a second file under the static webpage resource directory to the first directory;
the second mobile module is used for adding signature information to the filename of the picture file in the static webpage resource file directory and moving the filename to a second directory;
the first updating module is used for updating the reference relation of the reference picture files of the first file and the second file in the first directory based on the file names of the picture files in the second directory;
the second updating module is used for updating a third file in the static webpage resource directory based on the updated first file and the updated second file in the first directory;
and the packaging module is used for packaging the updated third file, the first directory and the second directory to realize the loading of the static webpage resources.
7. The apparatus for loading static webpage resources of claim 6, wherein the apparatus further comprises:
and the first cleaning module is used for cleaning the picture files with the same file name in the second directory after detecting that new picture files are added in the second directory, and reserving a preset number of picture files in a preset time period.
8. The device for loading the static web page resource according to claim 6, wherein the first updating module is specifically configured to:
traversing a first file and a second file under the first directory to determine a reference relation of the first file and the second file to reference the picture file;
replacing the file name of the first file in the first directory and the reference relation of the second file with the file name of the picture file referenced in the second directory;
signature information is added to the file name of the first file and the file name of the second file after the file name is replaced.
9. The apparatus for loading static webpage resources of claim 6, wherein the apparatus further comprises:
and the second cleaning module is used for cleaning the updated files with the same file name in the second directory, and reserving a preset number of first files and second files in a preset time period.
10. The apparatus for loading static web page resources of claim 6, wherein the second updating module is specifically configured to:
and updating the reference relation between the first file and the second file referred by the third file in the static webpage resource directory into the first file and the second file referred by the first directory.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method for loading a static page resource of any one of claims 1 to 5.
12. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of loading static page resources of any of claims 1 to 5.
CN201810691210.8A 2018-06-28 2018-06-28 Static webpage resource loading method, device, medium and electronic equipment Pending CN110727889A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810691210.8A CN110727889A (en) 2018-06-28 2018-06-28 Static webpage resource loading method, device, medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810691210.8A CN110727889A (en) 2018-06-28 2018-06-28 Static webpage resource loading method, device, medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN110727889A true CN110727889A (en) 2020-01-24

Family

ID=69216699

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810691210.8A Pending CN110727889A (en) 2018-06-28 2018-06-28 Static webpage resource loading method, device, medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110727889A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835578A (en) * 2021-01-28 2021-05-25 观脉科技(北京)有限公司 Bundle file generation method and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761497B1 (en) * 2001-07-13 2010-07-20 Vignette Software, LLC Storage medium having a manageable file directory structure
US20140281863A1 (en) * 2013-03-13 2014-09-18 International Business Machines Corporation Enhanced mobilization of existing web sites
CN106649395A (en) * 2015-11-03 2017-05-10 腾讯科技(深圳)有限公司 Webpage updating method and apparatus
CN107370791A (en) * 2017-06-23 2017-11-21 微梦创科网络科技(中国)有限公司 The method and system of filename in automatic synchronization renewal content distributing network
CN107704465A (en) * 2016-08-08 2018-02-16 腾讯科技(深圳)有限公司 Static resource update method and static resource management system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761497B1 (en) * 2001-07-13 2010-07-20 Vignette Software, LLC Storage medium having a manageable file directory structure
US20140281863A1 (en) * 2013-03-13 2014-09-18 International Business Machines Corporation Enhanced mobilization of existing web sites
CN106649395A (en) * 2015-11-03 2017-05-10 腾讯科技(深圳)有限公司 Webpage updating method and apparatus
CN107704465A (en) * 2016-08-08 2018-02-16 腾讯科技(深圳)有限公司 Static resource update method and static resource management system
CN107370791A (en) * 2017-06-23 2017-11-21 微梦创科网络科技(中国)有限公司 The method and system of filename in automatic synchronization renewal content distributing network

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835578A (en) * 2021-01-28 2021-05-25 观脉科技(北京)有限公司 Bundle file generation method and storage medium

Similar Documents

Publication Publication Date Title
US10142399B2 (en) Minimal download and simulated page navigation features
US20180027061A1 (en) Method and apparatus for elastically scaling virtual machine cluster
CN109936605B (en) Method and device for loading interface data
CN110795649A (en) Target page display method, device and system and electronic equipment
WO2020233096A1 (en) Page resource data processing method and apparatus, medium and electronic device
US11729248B2 (en) Web application component migration to a cloud computing system
CN111290871A (en) Method and device for acquiring crash information of application program
US8856216B2 (en) Method and apparatus for efficiently performing file services using cloud computing
CN111107133A (en) Generation method of difference packet, data updating method, device and storage medium
CN110874445A (en) Webpage loading method, client and business service center
CN111783005B (en) Method, device and system for displaying web page, computer system and medium
CN109614383B (en) Data copying method and device, electronic equipment and storage medium
CN113569173A (en) Page loading method and device, storage medium and electronic equipment
CN110727889A (en) Static webpage resource loading method, device, medium and electronic equipment
CN110674426B (en) Webpage behavior reporting method and device
US10705755B2 (en) Method, apparatus and computer program product for data backup
CN113220374A (en) Software processing method and device
CN109101429B (en) Method and device for debugging browser page of set top box
CN103139298A (en) Method for transmitting network data and device
CN113722007B (en) Configuration method, device and system of VPN branch equipment
CN115858978A (en) Page loading method and device based on updated resources
US20230083822A1 (en) Optimized rendering of web pages
US8793663B2 (en) Smart cache for a server test environment in an application development tool
CN113961298A (en) Page switching method, device, equipment and medium
CN113449216A (en) File processing method and device and storage medium

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