Drupal and Varnish a short introduction

Varnish is a HTTP accelerator (or reverse proxy). Its very much capable of processing 100,000 requests in a sec. Most likely quicker then Drupal, even with page caching on. Want to see how it works?   Cache hit User requests a URL Varnish checks it’s cache Varnish retrieves the data from the cache Varnish delivers…

Adding dynamic form elements using AHAH in Apply for for role Module

In Drupal AHAH is the best practice for adding removing from elements dynamically  I am not going to explain the basics if anyone want to learn what is AHAH go to http://drupal.org/node/331941. I have been using apply for role module in the registration form. I got a task form my client to add some fields dynamically in the…

Increase Drupal Performance by using Memcache

When site starting to get bigger with thousands of users and millions of records in database and lots of traffic performance becomes a major issue. Drupal is very powerful tool but it requires some fine tuning. I have built sites with thousands of users and hundreds of modules. What is Mencache? Memcached is an in…

Six Ways of Retrieving Webpage Content In PHP

There are so far 6 ways of Getting webpage content (full HTML) in PHP are most commonly used. The methods are using file() fuction using file_get_contents() function using fopen()->fread()->fclose() functions using curl using fsockopen() socket mode using Third party library (Such as “snoopy”) 1. file() <?php $url=’http://blog.oscarliang.net’; // using file() function to get content $lines_array=file($url); // turn…

How to crawl a website

The word “crawling” has become synonymous with any way of getting data from the web programmatically. But true crawling is actually a very specific method of finding URLs, and the term has become somewhat confusing. Before we go into too much detail, let me just say that this post assumes that thereason you want to…