drupalab's blog

Make Drupal load faster with Google analytics asynchronous tracking code

New Google analytics code loads asynchronously allowing your page to load faster. It is easy to migrate from old code snippet to asynchronous tracking code.

Asynchronous tracking is an improved way to track website visitors with Google Analytics. Unlike a traditional installation, asynchronous tracking optimizes how browsers load ga.js so its impact on user experience is minimized. It also allows you to put your Analytics snippet higher in the page without delaying subsequent content from rendering.

The new tracking snippet offers the following benefits:

Speeding up Drupal page loading on Windows by Zend Server CE

Many guys get problems with Drupal slow page-loading when deployed Drupal on Windows. I had the same problem with a customer's site. I suggested to move to Linux but they did not because of they love Windows and have lack of expertise on Linux. I have done some research and try other packages to develop Drupal on Windows from XAMPP, WAMP, Manually installing Apache, MySQL, PHP, APC or IIS-based but i could not get better.

Drupal performance: Reverse proxy with Varnish and PressFlow

I am running some Drupal based websites with most of anonymous visitors. I tried to cache Drupal content via Boost or CacheRouter module but they are not good as i expected. Sometimes, they consumed more CPU power than no cache. I started moving page cache to Varnish by setting up Varnish reverse proxy with Pressflow.

Setup Pressflow from Drupal (6.x)

I tweaked .htaccess so i need to keep .htaccess file only. To setup Pressflow from a running Drupal website, just copy and replace all Drupal files by Pressflow files.

Auto backup Drupal based websites to Amazon S3

I am running some Drupal based websites. I had to spent much of time for backup my websites daily/weekly. After i moved the websites to VPS and Dreamhost, i have ssh access so i wrote a small script to backup websites databases and user uploaded file to Amazon S3 automatically. The script is executed via cron tab daily. 

Enable apache solr search unicode (utf-8) on Tomcat

Apache Solr is a great full text search solution, i have set up it for some drupal based sites of mine. Everything works ok except it could not return return unicode query correctly. I have googled this prob for Drupal and Apache Solr integration but nobody asked before.

Finally, I talked a Java guru. He tell me about problem for Tomcat/Solr. There is no error at Drupal instance. I tried to fix this by googling about Solr unicode encoding. I fugured out by following configuration.

Adding URIEncoding="UTF-8" to server.xml of Tomcat config file. It should look like:

Improving Drupal's Performance with Quercus and Jetty (PHP in Java)

Quercus is Caucho Technology's 100% Java implementation of PHP 5 released under the Open Source GPL license. Quercus comes with many PHP modules and extensions like PDF, PDO, MySQL, and JSON. Quercus allows for tight integration of Java services with PHP scripts, so using PHP with JMS or Grails is a quick and painless endeavor. (Excerpted from Quercus)

Developing Python Web applications with Google App Engine

Google App Engine (GAE) is a cloud platform for hosting web applications. It does not like traditional web hosting, your web applications will run on Google Web Servers and you don't have to take care about server maintainance, administration. Google guys do it for you. It is launched April 2008 as free service but there are many limits and bugs in their plarform and API. They just have enabled billing for that service and will support more features.

Google App Engine overview

Backup MySQL databases automatically

AutoMySQLBackup is a great script that help us backup MySQL databases automatically. It can run thru cron job in or manually. It is easy to setup and make it works. I have just get it works only 5 minutes. The script uses mysqldump to backup MySQL databases so make sure you have it at your linux server/vps.

It is an open source/freeware so you are free to place it at your server/vps to backup your MySQL databases daily, weekly, monthy or manually.

AutoMySQLBackup features

How to import big MySQL database

 If you have some MySQL database files that bigger than 100MB, it is difficult to upload and import via phpmyadmin. Please use bigdump at http://www.ozerov.de/bigdump.zip it is the best tool to import big database files.

ChoiCungBe.com - A childcare website using Drupal 6

ChoiCungBe.com is a childcare website that is developed in Drupal 6 and some contributed modules. The site is using Acquia Marina Theme, one of the best free drupal theme. Some modules that are using at http://choicungbe.com are modified to match site owner's requirement. It is online but is still developing to support more features as multi-user blogging, personal gallery and some other social network features.