Automatic JavaScript slimming tool on Google App Engine

Source: Internet
Author: User
In order to improve the user experience, web applications often have a large amount of JavaScript. generally, some tools will be used to reduce the size of JS files before release, thus improving the download speed. every time you modify JS CodeIt is very troublesome to use a client or online tool for processing and then upload it to the web server. austinchau provides a library that automatically compresses JavaScript source files on the Gae server. in this way, the JS file can be uploaded directly after each modification, and you do not need to compress it with tools each time.

For example, suppose that your JS source file (uncompressed) is put under the/JS directory, the access address is: http://example.appspot.com/js/core.js, when the client accesses the http://example.appspot.com/Js_min/CORE. JS, the server automatically compresses the JS file and sends it to the client. js source file and the compressed version will be cached in memcache to improve efficiency.

This library is easy to use:
1. Download the two py files: javascript. py and jsmin. py, and upload them together with your code to your Google App Engine site;

2. Add the following two sentences to app. yaml (assuming that all your JavaScript source files are in the/JS directory ):

-URL:/JS .*
Script: javascript. py

3. Success!

Kuber @ feedzshare

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.