Revision of Varnish from Tue, 11/06/2012 - 11:50

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

Accelerate your Drupal/Pressflow site using Varnish

The primary reason for switching to Pressflow is to use an HTTP accelerator such as Varnish
Apache Configuration
Adjust your Apache configuration to server the Drupal site on port 8080. Edit your Apache conf file and add:

Listen 8080
NameVirtualHost *:8080

Restart Apache and make sure you can access your site on that port.

Varnish Configuration
Rather than change the default Varnish conf file, we'll create one just for Drupal:/usr/local/etc/varnish/drupal.vcl with Fourkitchens' basic configuration for Varnish 3.x and Drupal 7.

Drupal configuration
Edit your site's settings.php file and add your proxy to the $conf array, keeping any other settings that are there:

$conf = array(
    'reverse_proxy' => TRUE,
    'reverse_proxy_addresses' => array(
      '127.0.0.1', // Varnish web proxy
    ),
  );

Enable Drupal's page cache in admin/settings/performance and set the Caching Mode to External and Page Cache Maximum Age to an appropriate value (anything over 0).

Testing Varnish
You can test that Varnish is serving a cached page or not with:

curl -I http://yoururl.com

Resources
Varnish device detection and redirect to mobile site

Configuring Varnish for High-Availability with Multiple Web Servers

Boosted Varnish - High Performance Caching made easy

Configuring Varnish for High-Availability with Multiple Web Servers
Drupal and Varnish - some different adjustments for caching different stuff
Varnish and Pressflow (Drupal) - VCL tweaks for achieving a high hitrate
Varnishing over Drupal
Pressflow, Varnish and Caching … oh my! - their Google Analytics cookie code works. Also a sample VCL file
https://wiki.fourkitchens.com/display/PF/Configure+Varnish+for+Pressflow
http://janaksingh.com/blog/install-pressflow-drupal-varnish-apc-and-apache-centos-55-130
Using Pressflow behind a reverse proxy cache
Drupal, Varnish and Pressflow, Fast delivery to the customer with some speed for users too
Example Varnish VCL for Drupal/Pressflow Sites
Caching with Varnish, Drupla 7 and Cache Actions

Recent Updates

  • 2 years 2 days ago
  • 2 years 2 days ago
  • 2 years 4 days ago
    php 8.x
  • 2 years 6 days ago
    10.6.7
  • 2 years 1 week ago
    Drop Centos 5/6 stuff