CN111090455A - Method for optimizing WEB project front-end resource and reissuing war package - Google Patents

Method for optimizing WEB project front-end resource and reissuing war package Download PDF

Info

Publication number
CN111090455A
CN111090455A CN201911179730.1A CN201911179730A CN111090455A CN 111090455 A CN111090455 A CN 111090455A CN 201911179730 A CN201911179730 A CN 201911179730A CN 111090455 A CN111090455 A CN 111090455A
Authority
CN
China
Prior art keywords
file
folder
compression
picture
tool
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
CN201911179730.1A
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.)
Hangzhou Gudian Network Technology Co Ltd
Original Assignee
Hangzhou Gudian Network 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 Hangzhou Gudian Network Technology Co Ltd filed Critical Hangzhou Gudian Network Technology Co Ltd
Priority to CN201911179730.1A priority Critical patent/CN111090455A/en
Publication of CN111090455A publication Critical patent/CN111090455A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • 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/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files

Abstract

The invention discloses a method for optimizing front-end resources of a WEB project and reissuing a war package, which comprises the steps of simultaneously compressing a picture file, a JS file and a CSS resource file through background processing to generate a war package file, wherein a background comprises an exp folder and a tool folder, the exp folder comprises a src folder and a build folder, and the tool folder comprises a compression tool. The invention supports the expansion of the compression tool, and developers can select the compression tool which best meets the requirements of the project according to the requirements of the project. The invention integrates one-key release on the right key of the resource, is convenient and simple, and saves a large amount of maintenance release cost. When some resources do not need to be compressed, the invention can ensure the special requirements of the project through configuration setting.

Description

Method for optimizing WEB project front-end resource and reissuing war package
Technical Field
The invention relates to the field of computers, in particular to a method for optimizing front-end resources of a WEB project and reissuing a war package.
Background
The division of a web project is generally two-part: the method comprises a front end and a rear end, wherein the most part influencing the user access is often the page of the front end, in order to shorten the response time of the page and improve the user experience, the performance of the rear end service needs to be improved, and resources such as JS \ CSS \ images and the like at the front end can be subjected to hard compression through some means, so that the purposes of reducing network byte transmission, accelerating the page access speed and improving the user surfing experience are achieved. In order to not affect the development and debugging of developers, two versions of JS \ CSS files, one uncompressed version and one compressed (min or pack) version are also required to be simultaneously stored in a project, and screening is performed during release, so that not only is the maintenance cost increased, but also the release cost is increased, and a trouble is brought to the developers.
Disclosure of Invention
The invention aims to provide a method for optimizing front-end resources of a WEB project and reissuing a war package, which has a good compression effect and can be issued by one key, aiming at the defects of the prior art.
In order to achieve the purpose, the invention adopts the following technical scheme:
the utility model provides a method of optimizing WEB project front end resource and reissuing war package, carries out simultaneous compression through backstage supporter with picture file, JS file and CSS resource file, generates war package file, the backstage includes exp folder and instrument folder, the exp folder includes src folder and built folder, the instrument folder includes the compression instrument.
Further, the tool folder file comprises a pegtran tool, a pnguut tool and a gifsic tool, the pictures comprise a jpg picture, a png picture and a gif picture, and the jpg picture, the png picture and the gif picture are subjected to lossless compression respectively in the background through the jpeg tran tool, the pnguut tool and the gifsic tool.
Further, the tool holder file includes a yunoncompressor tool by which the CSS resource file is compressed in the background, and by which the js file is syntax-checked and compressed in the background.
Further, the original file to be compressed is placed under the src folder, and the file with the same name is generated under the build folder after the compression.
Further, the tool holder file includes a jsacker tool and a closure-builder tool.
Further, the compressed war package file is repackaged using bat batch processing.
Further, the compression process is integrated into the resource right key using the windows registry.
By adopting the technical scheme of the invention, the invention has the beneficial effects that: compared with the prior art, the method supports the expansion of the compression tool, and developers can select the compression tool which best meets the requirements of the project according to the project requirements. The invention integrates one-key release on the right key of the resource, is convenient and simple, and saves a large amount of maintenance release cost. When some resources do not need to be compressed, the invention can ensure the special requirements of the project through configuration setting.
Drawings
Fig. 1 is a prior art flow diagram one.
Fig. 2 is a prior art flow chart two.
FIG. 3 is a flowchart of a method for optimizing front-end resources of a WEB project and reissuing a war package according to the present invention.
Detailed Description
Specific embodiments of the present invention will be further described with reference to the accompanying drawings.
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict.
As shown in fig. 1 and 2, there are two general release methods, one is as shown in fig. 1, two sets of resources are provided for development, two sets of pictures are provided for art designer, two sets of JS are provided for development and debugging, two sets of CSS are provided for release, and then screening and packaging are performed during release; another method is shown in fig. 2, only one set of resources is provided during development, before packaging and publishing, individual resource compression and replacement are performed on the picture, JS and CSS resources, and then packaging and publishing are performed.
As shown in fig. 3, according to the method for optimizing front-end resources of a WEB project and reissuing a war package provided by the present invention, a picture file, a JS file, and a CSS resource file are simultaneously compressed through background processing to generate a war package file, where the background includes an exp folder and a tool folder, the exp folder includes a src folder and a build folder, and the tool folder includes a compression tool. Development and packaging are normal operations, namely conventional development and right click compression.
The tool folder file comprises a pegtran tool, a pnguut tool and a gifsic tool, the pictures comprise a jpg picture, a png picture and a gif picture, and the jpg picture, the png picture and the gif picture are subjected to lossless compression respectively in a background through the jpeg tran tool, the pnguut tool and the gifsic tool.
The tool holder file comprises a yuprecompressor tool, CSS resource files are compressed in the background through the yuprecompressor tool, and js files are subjected to syntax check and compression through the yuprecompressor tool.
And (3) putting the compressed original file under the src folder, and generating the file with the same name under the built folder after compression.
The toolholder file includes a jspack tool and a closure-builder tool.
Repackaging the compressed war package file using bat batch processing.
The compression process is integrated into the resource right key using the windows registry.
For example, if WEB resource optimization one-key packaging publishing is performed on xxx.war, the method performs processes of copying, decompressing, jpg/png/gif lossless compression, css compression, js syntax checking and compression, packaging and the like on the xxx.war package, and finally generates an optimized distributable XXX-release.war package under the xxx.war peer directory.
Wherein JPEG ran refers to an open source JPEG lossless conversion compression tool; pngo refers to a lossless size optimization tool for PNG pictures; giftile refers to a command line tool under unix for processing gif animation pictures, and also has an executable file under Win 32; the jspack is a compression tool of JS codes, is named Js compression expert in Chinese, can efficiently compress Javascript script files to shorten the webpage loading time, can confuse codes to protect intellectual property, and can merge and compress a plurality of files; yunoncorsor refers to a yahoo open source, written using pure java, tool for compressing JS and CSS files.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (6)

1. The utility model provides a method for optimizing WEB project front end resource and reissue war package, its characterized in that carries out simultaneous compression through background processing with picture file, JS file and CSS resource file, generates war package file, the backstage includes exp folder and instrument folder, the exp folder includes src folder and built folder, the instrument folder includes the compression instrument.
2. The method for optimizing front-end resources of a WEB project and reissuing a war package according to claim 1, wherein the tool holder file comprises a picture compression optimization tool, the pictures comprise a jpg picture, a png picture and a gif picture, and the jpg picture, the png picture and the gif picture are subjected to lossless compression respectively in a background through the picture compression optimization tool.
3. The method for optimizing front-end resources of a WEB project and reissuing a war package according to claim 1, wherein the toolholder file comprises compression optimization tools of JS and CCS, the CSS resource file is compressed in the background by the CCS compression optimization tool, and the JS file is subjected to syntax check and compression in the background by the JS compression optimization.
4. The method for optimizing front-end resources of a WEB project and reissuing a war package according to claim 1, wherein the original file subjected to compression is placed under an src folder, and the file with the same name is generated under a built folder after compression.
5. The method for optimizing front-end resources of a WEB project and reissuing a war package as claimed in claim 1, wherein the compressed war package file is repackaged using bat batch processing.
6. The method of optimizing WEB project front-end resources and reissuing a war package of claim 1, wherein the compression process is integrated into the resource right key using a windows registry.
CN201911179730.1A 2019-11-27 2019-11-27 Method for optimizing WEB project front-end resource and reissuing war package Pending CN111090455A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911179730.1A CN111090455A (en) 2019-11-27 2019-11-27 Method for optimizing WEB project front-end resource and reissuing war package

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911179730.1A CN111090455A (en) 2019-11-27 2019-11-27 Method for optimizing WEB project front-end resource and reissuing war package

Publications (1)

Publication Number Publication Date
CN111090455A true CN111090455A (en) 2020-05-01

Family

ID=70393799

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911179730.1A Pending CN111090455A (en) 2019-11-27 2019-11-27 Method for optimizing WEB project front-end resource and reissuing war package

Country Status (1)

Country Link
CN (1) CN111090455A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102725732A (en) * 2010-12-16 2012-10-10 华为技术有限公司 Method and device for improving mobile Widget application performance
CN105068813A (en) * 2015-08-19 2015-11-18 北京奇虎科技有限公司 Method and device for providing android package (APK) modification service
CN106202083A (en) * 2015-04-30 2016-12-07 阿里巴巴集团控股有限公司 Resource packaging system, method and device for web page
CN108519880A (en) * 2018-03-14 2018-09-11 广东能龙教育股份有限公司 Deep compression method for client application program installation package

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102725732A (en) * 2010-12-16 2012-10-10 华为技术有限公司 Method and device for improving mobile Widget application performance
CN106202083A (en) * 2015-04-30 2016-12-07 阿里巴巴集团控股有限公司 Resource packaging system, method and device for web page
CN105068813A (en) * 2015-08-19 2015-11-18 北京奇虎科技有限公司 Method and device for providing android package (APK) modification service
CN108519880A (en) * 2018-03-14 2018-09-11 广东能龙教育股份有限公司 Deep compression method for client application program installation package

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CAIJYI1: "WEB前端优化CSS,JS,图片", 《HTTPS://BLOG.51CTO.COM/JONYISME/1761559》 *

Similar Documents

Publication Publication Date Title
EP1076301B1 (en) Apparatus and method for loading objects from a primary memory hash index
US9031997B2 (en) Log file compression
US8117315B2 (en) Apparatus, system, and method for archiving small objects to improve the loading time of a web page
US7784039B2 (en) Compiler, compilation method, and compilation program
US10380329B2 (en) Method and apparatus for preventing application from being deciphered
CN109885324A (en) A kind of processing method, device, terminal and the storage medium of application program installation kit
WO2017219526A1 (en) Method for using graphic file format and storage device
CN111367524B (en) Enumeration type design method and device
CN105975311A (en) Application startup method and device
CN111176717B (en) Method and device for generating installation package and electronic equipment
WO2016202000A1 (en) Differential rollback upgrading method and apparatus
US20100023644A1 (en) Inspecting web browser state information from a synchronously-invoked service
CN111209001A (en) Method, system, equipment and medium for batch generation of APKs of android channels
CN114610640A (en) Fuzzy testing method and system for trusted execution environment of Internet of things
CN102207884A (en) File compiling method and device
EP3789882B1 (en) Automatic configuration of logging infrastructure for software deployments using source code
CN114398217A (en) Massive simulation waveform data slicing method for FPGA parallel simulation
CN111090455A (en) Method for optimizing WEB project front-end resource and reissuing war package
WO2019226251A1 (en) Code base sharing between standalone and web-based versions of an application via an emulated network communication channel
CN103139298B (en) Method for transmitting network data and device
CN111949491B (en) SQL extraction method and device of MyBatis application program
CN111522645B (en) Object processing method and device, electronic equipment and computer readable storage medium
AU2016378425B2 (en) Application program running method and apparatus
CN105704207A (en) Method for generating unique identifier, terminal and network side
CN112328693A (en) Block synchronization method, 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200501