News for hackers. Stuff that matters.
Re:Varnish in Five Acts by robmil on Friday May 03, 2013 @04:24PM (#5652422)
We eventually abandoned Varnish because the purging was too far from our application logic. nginx serves static content just as fast as Varnish does, and so getting our application to write static HTML files that were redirected to via nginx was just as quick as Varnish but easier to purge when needed.
Re:Varnish in Five Acts by evantahler on Friday May 03, 2013 @04:30PM (#5652473)
This is what we did at TaskRabbit, and here's our rails midleware to do it: https://github.com/taskrabbit/storehouse
Re:Varnish in Five Acts by robmil on Friday May 03, 2013 @04:55PM (#5652594)
We started off with our own toolkit for purging domains after deploys: https://github.com/robmiller/Varnish-Toolkit

But yeah, it just got a bit painful after a while.

Re:Varnish in Five Acts by mattwalker on Friday May 03, 2013 @04:06PM (#5652320)
Has anyone found a decent Varnish plugin for Sublime Text/Textmate? There's this -- https://github.com/zephirworks/Varnish.tmbundle -- but it hasn't been updated in a couple years and it fails for moderately complex configs.

The Python plugin works reasonably well for plain VCL syntax highlighting.

Re:Varnish in Five Acts by jjoergensen on Friday May 03, 2013 @05:22PM (#5652714)
I do not think that he should overwrite vcl_hash. By default Varnish caches by the request host and not the backend host?

Here is the default:

sub vcl_hash { hash_data(req.url); if (req.http.host) { hash_data(req.http.host); } else { hash_data(server.ip); } return (hash); }

Re:Varnish in Five Acts by spooneybarger on Friday May 03, 2013 @05:28PM (#5652743)
it caches by host. this would allow you to serve multiple sites through it like:

example.com/foo

and

another.com/foo

without a cache collision.

we don't care about the host as everything is of the same entity service type.

Re:Varnish in Five Acts by jjoergensen on Friday May 03, 2013 @05:39PM (#5652794)
I must have scanned the blog post too quickly. Thanks for the clarification.
Re:Varnish in Five Acts by KevBurnsJr on Monday May 06, 2013 @06:50AM (#5661718)
It's nice to see x-invalidates in the wild!

Do you have just 1 varnish instance or two?

I never did fully solve the ban propagation problem when running multiple redundant varnish instances.

Re:Varnish in Five Acts by spooneybarger on Monday May 06, 2013 @07:23AM (#5661798)
1 for each service. If we need to scale beyond one per service, I plan on doing sharing across varnishes based on url so we don't have to propagate bans.
Re:Varnish in Five Acts by j7 on Friday May 03, 2013 @02:55PM (#5651907)
Varnish is pretty awesome, but gets complicated when you have user-specific content. You can use things like edge-side includes and such, but it becomes more than plug and play at that point.
Re:Varnish in Five Acts by robmil on Friday May 03, 2013 @04:22PM (#5652408)
For a lot of sites, either using ESIs or including dynamic content via AJAX is a fairly simple solution that still leaves you with the benefits of caching.
Re:Varnish in Five Acts by megaman821 on Friday May 03, 2013 @04:27PM (#5652441)
For light page customizability like Hello Username. I will include the username in a browser cookie and use some JavaScript to insert it into the page. This way I can still use Varnish to serve most pages.
Re:Varnish in Five Acts by spooneybarger on Friday May 03, 2013 @03:03PM (#5651960)
to make sure I understand, you meant it becomes more plug and play when you use ESI?
Re:Varnish in Five Acts by IbJacked on Friday May 03, 2013 @03:46PM (#5652226)
I believe he is saying it becomes less plug and play. By saying "it becomes more than plug and play at that point," he means it becomes more effort than plug and play.

That's my read on it, anyway. It always gets dicey interpreting the intent of others :)

Re:Varnish in Five Acts by j7 on Friday May 03, 2013 @03:51PM (#5652254)
Correct, it "becomes more complicated" is what I meant.
Re:Varnish in Five Acts by spooneybarger on Friday May 03, 2013 @03:51PM (#5652255)
ah yes, that makes sense.

thanks.

Re:Varnish in Five Acts by lucid83 on Friday May 03, 2013 @06:58PM (#5653148)
What did you use to generate those graphs? Love 'em, have to know.
Re:Varnish in Five Acts by KevBurnsJr on Monday May 06, 2013 @06:46AM (#5661711)
Re:Varnish in Five Acts by spooneybarger on Friday May 03, 2013 @07:23PM (#5653236)
Graphite
Re:Varnish in Five Acts by jconnolly on Friday May 03, 2013 @04:22PM (#5652405)
need to write me some pygments-vcl for vcl syntax highlighting in octopress and elsewhere.
Re:Varnish in Five Acts by jconnolly on Friday May 03, 2013 @03:04PM (#5651973)
what's up with the /donjohnson/pulse url?
Re:Varnish in Five Acts by fallous on Friday May 03, 2013 @03:45PM (#5652223)
A reference to Don Johnson's terrible "Hearbeat" song from the 80s?
Re:Varnish in Five Acts by spooneybarger on Saturday May 04, 2013 @06:27AM (#5654644)