[Urgent] How does one implement automatic css js compression in CDN?
Initial requirement
For high website concurrency, we need to compress images, CSS, and JS resources to save the bandwidth of server traffic resources.
Server Configuration: Master 1, three at a time. The primary Win64 + WAMP, which is automatically allocated to the domain name through DNS resolution.
Solution
Add the Google JSMinify library to the master server, and rewrite all access to CSS/JS files in the resource folder/Public to the JSMinify program. JSMINIFY is automatically compressed and can only be cached by gz.
Demand change
Migrate Public resources to CDN. The new CDN only provides FTP, the server is configured with LInux + Nginx, does not support PHP, does not support htaccess, does not support unique settings of the server, only provides FTP account password!
Personal Solutions
1) each time the Public resources are uploaded, copy them to the CDN, compress them one by one, and upload them to CDN one by one. Problem: JS/CSS on the website is frequently changed. If you change the upload every day, it takes a lot of time to compress it. And prone to errors. 2) use JSMinfiy to create a tool that can compress specified directories. Problem: It takes time to make and test. However, other jobs are quite busy. 3) with special software, you can specify a directory for automatic compression. Question: recommendation.
Now I personally think the best solution is the third point. Are there any software tools that can compress JS/CSS files in the specified directory?
Or other solutions?
Google Minify Download: https://code.google.com/p/minify/
Reply to discussion (solution)
The editor does not support file compression. after each file is modified, it is implemented through the editor.
The editor does not support file compression. after each file is modified, it is implemented through the editor.
Which editors can be compressed. Notepad ++ does not seem to work.
Notepad + is also supported. you need to install a plug-in.
Notepad + is also supported. you need to install a plug-in.
It has been solved. use the minify program to automatically compress