Accelerate your AJAX application

Source: Internet
Author: User
Ajax

The digg.com, claiming to surpass Slashdot, is a typical AJAX application. Its homepage uses the prototype frame and the scriptaculous extension.  Some good people count the load digg.com home when the total download Javascript and css file bytes, found that not on the picture, light html+js+css has more than 250 k, then put forward Digg:javascript overload? Zimbra for this problem, some optimization methods are given: AJAX and CSS optimization, the main points are as follows:

Integrate more than one JS or css file into a single file to reduce the number of HTTP connections, use similar jsmin tools to remove annotations, blanks, and extra empty lines to reduce the amount of data transferred by the network, and use the gzip compression compression Zimbra in the Web service side to optimize , the test found that the bandwidth was reduced by more than 50%.

We must also encounter similar digg.com performance problems in our current and future AJAX development. Zimbra solutions are available for your reference. About HTTP Compression, I think is the most critical part of optimizing Ajax. We can apply the mechanism provided by the Web server by default, such as the compression option provided by tomcat5.x in the connector configuration, a typical connector configuration is as follows:

port= "8080" maxhttpheadersize= "8192" maxthreads= "25"

maxsparethreads= "enablelookups=" "false" redirectport= "8443"

Acceptcount= "connectiontimeout=" "20000" disableuploadtimeout= "true"

Compression= "On"

Compressablemimetype= "Text/html,text/xml,text/plain,text/javascript,text/css"

/>

The above configuration uses the compression property to activate compression, and then applies the compressed MIME type type with the Compressablemimetype property setting. The most famous Apache server also provides modules such as mod_deflate to provide similar compression configurations.

You can also provide compression by invoking API programming provided by Web server, such as using Java to provide a gzipfilter application to the servlet container.



Related Article

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.