How to implement CSS/JS automatic compression scheme in "Urgent request" CDN?

Source: Internet
Author: User
Initial Requirements
Site high concurrency, you need to use the image/css/js resources to compress, to conserve server traffic resource bandwidth.
Server configuration: Primary 1, secondary 3 units. The main win64+ WAMP, through DNS automatic resolution allocation point.

Solution Solutions
The master server joins the Google jsminify Library, overwriting all access to the Css/js file under the Resource folder/public to the Jsminify program. Jsminify is automatically compressed and can only be cached in GZ.

Changes in requirements
Requires that resources for public be migrated to the CDN. The new CDN only provides FTP, server configuration Linux+niginx, does not support PHP does not support htaccess, does not support the unique server settings, only provide FTP account password!

Solutions for Individuals

1) Each time you upload the resources in public, copy one to come out, then manually compress them individually, then upload them to the CDN. Question: Now the JS/CSS in the website are often changed. If you change uploads every day, it can take a lot of time to compress. and error prone. 2) Use Jsminfiy to create a tool that can specify a directory for compression. Problem: It takes time to make and test. But other work is very rush. 3) Using specialized software, you can specify a directory to compress the software for automatic compression. Problem: Ask for recommendations.


Now personally think the best solution is the 3rd, for the recommendation, there are no js/css files can be compressed to the specified directory software tools?
or a different solution?

Google minify Download: https://code.google.com/p/minify/




Reply to discussion (solution)

The editor is not able to compress the file, and it is implemented by the editor each time the file is modified.

The editor is not able to compress the file, and it is implemented by the editor each time the file is modified.



Which editors can compress. Notepad++ doesn't seem to be.

Notepad+ can also, need to install plug-ins.

Notepad+ can also, need to install plug-ins.



has been resolved, using the Minify program to automatically compress the
  • 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.