Show your support for Zikula! Sign up at Github account and watch the Core project!
Let Google Host Your Ajax Libraries
All Google conspiracy theories aside, Google actively host's popular Ajax frameworks, so why not take advantage of them?
First, if you are wondering what the advantage is, it is rather quite simple. Prototype and Script.aculo.us are very common frameworks. It makes little sense that every time a browser needs one of these popular frameworks that it needs to download it and cache it to your browser. How many copies does your browser needed? Probably just one, as you have guessed. This means every time that a framework is requested from Google, your browser already has it cached, reducing the need for another HTTP request.
But not only is this an advantage to your browser, it also is an advantage to your server, as it less files it has to serve. Less files equates to less server usage and less bandwidth.
We know that Zikula requests these dynamically, and we really do not want to hack the core files to make the redirects, so a simple work around is to have Apache make use of mod_rewrite with an .htaccess file. To keep it simple we will use the .htaccess file at the Zikula root directory.
Since .htaccess files can very with Zikula, you will have to adjust according to your situation. But It should look something like this:
# security options
php_flag register_globals off php_flag magic_quotes_gpc off
Options FollowSymLinks RewriteEngine On
This makes a 301 redirect to Google. There you go a quick and dirty guide!
For more information see: http://code.google.com/apis/ajaxlibs/documentation/index.html
Share This | Print