Setting a cookie in nginx is easy. Look at the following example of setting the cookie lcid with the value 1033 when a page url starts with "/fr/":
location ~* (^/fr/) {
add_header Set-Cookie lcid=1033;
# ...
A recent project had the requirement for detailed and instant visitor tracking integrated into the admin gui of a high traffic site.
When installing Apache web server, it's a good idea to enable the mod_deflate and mod_expires modules. Mod_deflate enables Apache to serve compressed content which is then decoded by the receiving browser.
Redis is a high performance key-value store that can be easily integrated with a variety of applications. Redis can handle many inserts (sets) by keeping newly added values in memory and writing them to disk over time. To install Redis on CentOS 5.6, run the following commands as root.
Highly scalable Drupal sites require a caching solution more robust than the default database-backed cache. In-memory storage is very popular because of its performance and relatively easy installation, and Memcache and APC seem to be the two most popular options.
Drupal Integration
There's a common Drupal setting that allows you to optimize and JavaScript or CSS in the Site Configuration > Performance menu. Turning this setting on will minify and concatenate all of these used files into a single JavaScript and single CSS file.
One of the cooler features in PHP 5 is the SPL autoloading capability, which allows dynamic loading of classes without you having to “include” or “require” each specific one.
After quite a few failed attempts the get Limelight origin-pull CDN integration to work with a new Drupal Pressflow 6 site that I’ve been working on, I finally reached the magic combination of Drupal and Apache settings.
Pressflow, a high performance version of Drupal, supports master slave setups in its database include files.
A few months ago while debugging a Wordpress site and outputting queries into a log, I noticed that queries were getting fired for pages that I wasn’t even looking at.