From my understanding, varnish needs custom headers sent to it, thus the patch for core; Boost already sends custom headers. I can rip out the varnish control code for cache deletion from the varnish project. With cache creation and deletion, the basic parts of boost can work with varnish.
http://drupal.org/project/varnish

I originally thought these 2 projects where too different but in reality they are quite similar ATM. This should take varnish to the next level allowing almost all of the advanced features of Boost, but using Varnish instead of files for storage. This will be useful up until someone figures out ESI; but that can be used with Varnish & Nginx; and ajax loading is the alt to ESI, so I see this as a separate module that controls this.
http://en.wikipedia.org/wiki/Edge_Side_Includes

Comments

mikeytown2’s picture

After talking with the people in the varnish IRC channel; it appears that I can't use any of the advanced features of varnish like page hits and other things like that; without some hassles. Thus I'll use Varnish just like I use the file system, a simple storage medium.

Option B From IRC:
"actually, you can do stuff like GET /$url?statsonly and then in vcl_hit do an error with the appropriate stats and ditto in vcl_miss. No backend request required."

joshk’s picture

I'm all in favor of bringing these together. However, I have some questions:

What are the advanced features of Boost are that we'd be including?

Also, given that Boost uses a write-based logic for caching pages, and Varnish does not, I don't know how much of the existing Boost code is directly applicable. Varnish's workflow is a bit different.

However, if this means unifying modules, and/or Drupal 6 users can take advantage of Varnish without having to patch their Core, it's a big win.

mikeytown2’s picture

Very little logic in boost revolves around the actual file it's self; as long as the purge command in varnish works, there isn't a lot of works that needs to be done in order to make this happen. The fact that there is a filename stored in the database as the primary key doesn't mean a whole lot; I have the URL in there as well. Integrating varnish will help to make the boost code more generic; allowing for memcache storage in the future (Nginx).

All I need is cache creation and cache deletion; boost handles the rest.

mikeytown2’s picture

aruna.kulatunga’s picture

will be following this. Boost+Varnish will make Drupal steam....

adrianmak’s picture

subscribe

Fabianx’s picture

It is actually quite easy to combine varnish with boost if boost crawler is used (the records are duplicated though on disk and mem):

acl purge {
        "localhost";
        "127.0.0.1";
        "<ip boost is using>";
}

sub vcl_recv {

[...]

  if (client.ip ~ purge) {
    purge("req.url == " req.url " && req.http.host == " req.http.host);
  }

}

purging all records that are asked for from local ... (plus removing no-cache headers from cache/.htaccess)

Of course a PURGE request could also be sent via normal cron expire ...

Best Wishes,

Fabian

Fabianx’s picture

A followup to this:

To achieve full boostability with varnish and also making efficient and clever use of the boost crawler will all be detailed in my proposed session for Drupal Con London:

http://london2011.drupal.org/conference/sessions/boosted-varnish-how-inc...

I'll also write up the results here and link to a blog post explaining it in detail once I've cleaned up all the configuration.

Let me just tell you this:

Boost and Varnish are an excellent combination.

- Boost for the durability
- And Varnish for the "hot" pages and assets

Best Wishes,

Fabian

mikeytown2’s picture

@Fabianx
Cool presentation. It would be pretty sweet if this got picked for DrupalCon!

ckreutz’s picture

@Fabianx
yes, I would also be interested to see your results. I made some good first experiences combining varnish and boost.

karljohann’s picture

This idea is very appealing to me, any progress been made?

mealto’s picture

Varnish made our Drupal pages load pretty quickly. Unfortunately, with Varnish enabled, our writers were constantly getting logged out. Looks like when they open a new tab or window to browse our own website, the original browser that they have used to write an article would kick them out, thus, not saving the article. Because of this, we had to remove Varnish, what a pity. On a side note, is there a fix for this?

Fabianx’s picture

@karljohann:

Yes, see here:

http://www.trellon.com/content/blog/boosted-varnish-high-performance-cac...

I now also have a minimal Drupal 7 version working. (which is not using Boost at all, but just a boosted_varnish helper module).

karljohann’s picture

Ah yes, thank you Fabian, that is very useful. I however cannot set a time limit on the cache flush because we're running a news site that often needs to be updated every other second. I'm currently trying out the Expire module but there are a lot of Boost options I'd like to see there.

bgm’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue tags: +varnish

(i'm not planning on working on this, just doing bug triage: bumping to 7.x-1.x and tagging)

mikeytown2’s picture

Status: Active » Closed (won't fix)

D7 core has the headers; going to close this as I currently use boost and varnish in D6, no special coding required.