6 ms·
Varnish in Five Acts
- j7 13y agoVarnish 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.
- spooneybarger 13y agoto make sure I understand, you meant it becomes more plug and play when you use ESI?
- IbJacked 13y agoI 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 :)
- j7 13y agoCorrect, it "becomes more complicated" is what I meant.
- spooneybarger 13y agoah yes, that makes sense. thanks.
- robmil 13y agoFor 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.
- megaman821 13y agoFor 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.
- deleted 13y ago[deleted]
- jconnolly 13y agowhat's up with the /donjohnson/pulse url?
- fallous 13y agoA reference to Don Johnson's terrible "Hearbeat" song from the 80s?
- spooneybarger 13y agoindeed... https://www.youtube.com/watch?v=ULI5kolBpAk https://www.youtube.com/watch?v=ULI5kolBpAk
- mattwalker 13y agoHas anyone found a decent Varnish plugin for Sublime Text/Textmate? There's this -- https://github.com/zephirworks/Varnish.tmbundle 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.
- jconnolly 13y agoneed to write me some pygments-vcl for vcl syntax highlighting in octopress and elsewhere.
- robmil 13y agoWe 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.
- evantahler 13y agoThis is what we did at TaskRabbit, and here's our rails midleware to do it: https://github.com/taskrabbit/storehouse https://github.com/taskrabbit/storehouse
- robmil 13y agoWe started off with our own toolkit for purging domains after deploys: https://github.com/robmiller/Varnish-Toolkit https://github.com/robmiller/Varnish-Toolkit But yeah, it just got a bit painful after a while.
- jjoergensen 13y agoI 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); }
- spooneybarger 13y agoit 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.
- jjoergensen 13y agoI must have scanned the blog post too quickly. Thanks for the clarification.
- lucid83 13y agoWhat did you use to generate those graphs? Love 'em, have to know.
- spooneybarger 13y agoGraphite
- KevBurnsJr 13y agoStatsd is awesome. http://codeascraft.etsy.com/2011/02/15/measure-anything-measure-everything/ http://codeascraft.etsy.com/2011/02/15/measure-anything-meas...
- KevBurnsJr 13y agoIt'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.
- spooneybarger 13y ago1 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.