Optimizing Ajax applications automagically through Apache modules/Google mod_pagespeed
Optimizing Ajax applications automagically—without manual effort— is the most wanted tool for any developer. There are a few tools invented for that purpose. In this recipe, we'll see a few such automatic tools.
Getting ready
We'll require a web application running over an Apache web server. For automatic optimization, we need the following Apache modules:
mod_deflate
, available at http://httpd.apache.org/docs/2.0/mod/mod_deflate.htmlmod_expires
, available at http://httpd.apache.org/docs/2.0/mod/mod_expires.htmlmod_pagespeed
, available at http://code.google.com/p/modpagespeed/
How to do it...
We have to install these modules and then set up the configurations for them to automatically handle the requests. We'll see the configurations for each module:
mod_deflate
:To enable automatic
gzip
handling for JavaScript, CSS, and HTML code, we can useAddOutputFilterByType
and specify their MIME type:<IfModule...