Skip to main content

Posts

Showing posts from 2017

Upgrading to Drupal 8 with Varnish, Time to Upgrade your Mental Model as well

I've been using Varnish with my Drupal sites for quite a long while (as a replacement to the Drupal anonymous page cache). I've just started using Drupal 8 and naturally want to use Varnish for those sites as well. If you've been using Varnish with Drupal in the past, you've already wrapped your head around the complexities of front-end anonymous page caching, presumably, and you know that the varnish module was responsible for translating/passing the Drupal page cache-clear requests to Varnish - explicitly from the performance page, but also as a side effect of editing nodes, etc. But if you've been paying attention to Drupal 8, you'll know that it's much smarter about cache clearing. Rather than relying on explicit calls to clear specific or all cached pages, it uses ' cache tags ' which require another layer of abstraction in your brain to understand. Specifically, the previous mechanism in Drupal 7 and earlier was by design 'conservative&

CiviCRM's invoice_id field and why you should love the hash

I've been banging my head against a distracted cabal of developers who seem to think that a particular CiviCRM core design, which I'm invested in via my contributed code, is bad, and that it's okay to break it. This post is my attempt to explain why it was a good idea in the first place. The design in question is the use of a hash function  to populate a field called 'invoice_id' in CiviCRM's contribution table. The complaint was that this string is illegible to humans, and not necessary. So a few years ago some code was added to core, that ignores the current value of invoice_id and will overwrite it, when a human-readable invoice is generated. The complaint about human-readability of course is valid, and the label on the field is misleading, but the solution is terrible for several reasons I've already written about. In this post, I'd like to explain why the use of the hash value in the invoice_id field is actually a brilliant idea and should b

What to do in the age of Trump?

Well, that's the question of the day. If you're part of an organization that does advocacy work, rather than waiting to see what happens first, might as well get yourself ready, even if the details are sketchy still. Here's one opportunity that's ready for you now, message courtesy of Steve Anderson of OpenMedia. OpenMedia , David Suzuki Foundation , SumOfUs and a range of other organizations are supporting a new shared set of civic engagement tools. Vancity Community Foundation is providing some support to subsidize some of the cost of the tools to select values-aligned organizations that sign up before February 28th. Interested? You can learn more or book a demo from here:  http://tools.newmode.net/ Here's some live examples of the tools you can take a look at: 1. Click to Call : http://www.davidsuzuki.org/blogs/healthy-oceans-blog/2016/11/to-help-protect-canadas-oceans-weve-made-it-easy-to-call-your-mp/#newmode-embed-4-266 Check out this video of Dav

Using varnish in front of a webhosting canada or other shared hosting site? Pay attention to your probe!

I've had a varnish installation protecting http://www.fairvote.ca -- a wordpress site hosted at webhosting canada (whc.ca) -- for about a year. Last Friday in the evening, it started spitting out 503 errors, for no obvious reason. I spent a few hours yesterday in vain trying to get the hosts to tell me what, if anything might have changed at their end. What I eventually figured out is that they changed how their servers respond to http requests without a domain - previously it was a 200, and it became something else (a redirect, I believe). That's not unreasonable (though relatively pointless to change at this stage, I would imagine), except that, by default, varnish probes its backends with requests that don't have a domain. What that meant is that varnish started thinking that the backend was broken, so stopped talking to it (even though it was perfectly capable of doing so). The fix was just to add a customized probe that included a valid domain to the request.