This is a past event. Please join us for Web Summer Camp this year.

HTTP caching with Varnish

About

For some scenarios, Varnish is the silver bullet to fix performance issues and go from slow site to lightning fast site. More often though, you will need to put some effort into your application to get good results. Ideally, you design your application to play well with caching from the outset. If you don't know what you are doing, Varnish can also be the bullet to shoot yourself in the foot.

In this workshop, you will learn how to use HTTP headers to control caching and how to configure Varnish itself. Running your own vagrantbox with Varnish and PHP, you get to try out the effects of the caching headers and of Varnish configuration directives. We will discuss things that go well with Varnish and situations to avoid. After mastering the basics, we look at advanced concepts like edge side includes (ESI).

With this knowledge, you will be able to set up and configure Varnish. You know how to build applications with caching in mind, and can assess whether an application is ready for Varnish or what needs to be fixed.

Setting up developer environment 

You can follow the workshop better with the virtual appliance configuration used at the event. Check out the main repo and follow the instructions. In a nutshell, you should be able to create the Vagrant box with:

$ git clone https://github.com/netgen/summercamp-2015.git
$ cd summercamp-2015
$ git submodule init
$ git submodule update
$ vagrant up --no-provision

Then add all domains in the hosts as explained in the README.

To prepare this workshop, you should then:

$ vagrant ssh
(vagrant)$ cd /var/www/summercamp/
(vagrant)$ ./run.sh httpcache

You should have the workshop accessible in your browser at http://httpcache.phpsc/. If you have problems, check the FAQ. If you still have problems, you can fall back to using only workshop repo listed here.

Video - part 1

embed_video

Video - part 2