Varnish Edge Side Includes

July 15, 2010

Zend Framework

A few days ago, Bas de Nooijer wrote an interesting article “Controlling Varnish ESI inside your application” in which he discusses one of the more interesting aspects of Varnish, Edge Side Includes. Specifically, he discusses how you can control the use of ESIs from within your Zend Framework based application.

For me one of the best features of Varnish is ESI (Edge Side Includes). It allows you to combine elements with different lifetimes into a single page. This way you don’t need to regenerate a complete page as soon as a news listing somewhere on the page changes. And you can still cache pages while displaying user-specific information somewhere on the page.

This lowers the load on your application even further and it can also help in simplifying your application, by focusing purely on the content of the page and loading all other elements via ESI.

The blog post itself is not long and the majority of it is code. It assumes you have Varnish setup and running and understand the concepts involved. This is not a beginner’s article. The sample PHP code is specific to Zend Framework. This means that those not using Zend Framework won’t be able to simply copy and paste the sample code but c’mon, you know you shouldn’t be doing that anyhow.

If you are currently using Varnish in your stack, this is an interesting blog post that may spark your imagination. If you are not, reading the post may just result in you having to install Varnish on your development server to see what all the excitement is about.

About Cal Evans

Many moons ago, at the tender age of 14, Cal touched his first computer. (We're using the term "computer" loosely here, it was a TRS-80 Model 1) Since then his life has never been the same. He graduated from TRS-80s to Commodores and eventually to IBM PC's. For the past 10 years Cal has worked with PHP and MySQL on Linux OSX, and when necessary, Windows. He has built on a variety of projects ranging in size from simple web pages to multi-million dollar web applications. When not banging his head on his monitor, attempting a blood sacrifice to get a particular piece of code working, he enjoys building and managing development teams using his widely imitated but never patented management style of "management by wandering around". Cal is currently based in Nashville, TN and is gainfully unemployed as the Chief Marketing Officer of Blue Parabola, LLC. Cal is happily married to wife 1.28, the lovely and talented Kathy. Together they have 2 kids who were both bright enough not to pursue a career in IT. Cal blogs at http://blog.calevans.com and is the founder and host of Day Camp 4 Developers

View all posts by Cal Evans

Comments are closed.