[Urgent] How does one implement automatic CSS/JS compression in CDN?

Source: Internet
Author: User
[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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.