I’m proud to announce that my Varnish book is out now. It’s called “Getting Started With Varnish Cache” and it’s available for download through Varnish Software. For the next 30 days, Varnish Software has the exclusive rights to distribute the book. After that, O’Reilly will also be distributing physical copies and the digital version of the book, while Varnish Software will continue to distribute the book on their website.
Getting Started With Varnish Cache: the announcement video
The video above is the announcement video to promote the book. Yes, that’s me trying to be slick.
The official Varnish book
I was surprised and honored with the invitation. But I had my doubts: why me? Am I good enough to write a book? How am I going to manage, because I have no time for this?
Hildur Smaradottir, the VP of Marketing at Varnish Software explained that it would be published by O’Reilly and that this book was important to her and the company. Varnish Software would act as a sponsor. At that point I knew this was serious and I knew it was an opportunity that I shouldn’t pass on.
And on April 12th 2016, I sent her the following e-mail. It was very brief and to the point:
Hi Hildur, I'M IN ! Let's do this! Thanks for the opportunity Thijs
At that point I was ready to write the official Varnish book. But how do you write a book?
I’ve written blog posts and whitepapers before. I like writing stuff and in my presentations I like building up a certain narrative. My English is good, but is it good enough for an actual book? Luckily I had an idea for the outline of the book, based on Varnish presentations and workshops I had given in the past.
Brian Anderson and Virginia Wilson, my editors at O’Reilly sent me some information and some forms to fill out. After that, a Skype call was set up where they gave me some advice. I wrote the intro chapter and sent it to Varnish Software and O’Reilly. They liked it, and I was all set.
There was a bit of back and forth, some meetings were arranged with Varnish Software about the angle, the story and the content. I was granted access to the O’Reilly Atlas platform, the authoring platform I had to use. I wrote the manuscript in AsciiDoc format, kept track of my changes using Git, pushed the changes to the Atlas platform via git push, and built the example PDFs using the Atlas Ruby Gem.
On Monday June 20th I wrote my very first paragraphs and this is the commit message:
commit 36c85152e3c6b6e1078dad21293f621c0c36bd4c Author: Thijs Feryn <firstname.lastname@example.org> Date: Mon Jun 20 10:55:06 2016 +0200 Giving this a first go
193 commits followed.
I was presented with some deadlines:
- 50% of the manuscript by September 1st
- Full manuscript by December 1st
- Review and quality control until February 1st
Between December and February, Melanie Yarbrough was my main contact. She’s my production editor and she coordinated the review. She brought in Gillian McGarvey as a copy editor. Melanie and Gillian rigorously reviewed my manuscript, corrected errors and turned the manuscript into an actual book.
I sure hope we removed all the typos …
Varnish to the rescue
I’ve been working with Varnish since 2009 and gradually gained experience. I work at a hosting company, so I had plenty of practice. And throughout my career, there was a recurring pattern when it came to web performance and HTTP best practices:
A lot of developers don’t know about HTTP best practices and haven’t got a solid plan to make their code scale when the pressure is on.
It’s safe to say that Varnish is the goto technology that saved many of our client’s asses. Nearly every week I’m in a meeting where big brands are in trouble and need help scaling their site. In 95% of the cases, Varnish is the solution, or at least part of the solution.
Over the years I’ve written a lot of VCL code, most of it was custom code to improve the hit rate for specific sites. There were recurring patterns that I copy/pasted, but the rest of the VCL code was just compensation for the lack of built-in HTTP best practices.
These are the common pitfalls with web applications that are hard to cache:
- A decent cache-control discipline
- Too many cookies
- Too much information is stored in sessions
- Sessions are initialized, even when they’re not required
- No way to control cacheability from within the MVC layer
- No clue what cache variations are
- The project owner is not able to list all routes
- The project owner has a hard time listing the cacheable routes
- The project owner has a hard time listing the cookie usage across the application
What’s the angle of this Varnish book?
After a while, I had a feeling that all my efforts were band-aids and not the proper cure. I wanted to figure out a plan, a strategy that works for everyone.
Instead of focussing on writing VCL, I was about to focus on evangelizing HTTP best practices, which Varnish and other reverse proxies comply with out-of-the-box.
I’m all about developer empowerment. And that’s the angle of the book. But I’m realistic enough to know that you can’t just throw in some HTTP header mumbo jumbo. The story needs to build up to this.
Of course, I also needed to explain how Varnish works, how to set it up and how to write VCL. The book wasn’t only aimed at developers. The book also targets sysadmins, CTOs and CIOs. It needed to be a low-threshold book, that explains Varnish, but that also inspires developers to write better code.
Here’s the chapter list of my Varnish book:
- What is Varnish Cache?
- Go, Go, Go and Get Started!
- Varnish Speaks HTTP
- The Varnish Configuration Language
- Invalidating the Cache
- Dealing with Backends
- Improving your Hit Rate
- Logging, Measuring, and Debugging
- What Does This Mean for Your Business
- Taking It to the Next Level
One hell of a ride
I’m very grateful for the opportunity. I didn’t expect to enjoy it so much. Make no mistake: it was a lot of work. But I’m happy to admit it was a smooth ride, and I didn’t feel depressed at all. I encountered some issues, but with some help from Varnish Software and O’Reilly we manage to tackle them swiftly.
I learned a lot about writing in a “foreign” language. Not that I’ll write flawless English from now on. But it was quite inspiring.
I’d like to thank the people at Varnish Software for this incredible opportunity. Thanks Hildur, you’re awesome! I’d like to thank the people at O’Reilly for the help. And a BIG shout-out to my colleagues at Combell for all the support.
Let’s ride this wave for a while and see what kind of opportunities come along. In a couple of weeks I’ll get my hands on the first physical copies, that’ll be the most exciting part!
It was a fun experience, and it’s probably not the last book I write.