Report inadequate content

Varnish in Harecoded


VCL's Varnish syntax highlighting for PHPStorm

If you are looking for Varnish syntax highlighting for PHPStorm, as per today, you won't find a plugin. This post is not publishing a plugin for proper vcl syntax highlighting but a quick hack to see some coloring.

Given the fact Varnish configuration files are very similar to C I tried to associate the .vlc type to C files.  It is not rocket science but at least your eyes...


Determining the real client IP with Varnish (w/ X-Forwarded-For)

If you implement Varnish in your application one of the early things that you discover is that  any IP functionalities you had are now gone. Some examples are:

GEOIP does not resolve the country Apache logs write as request client IP (or another IP of your LAN) My own PHP logic cannot longer apply filters by IP

Why? Well, it's easy to answer. That's...


Varnish VCL: Delete ALL cookies and other magic

This morning Javi Callón gave me a great introduction in few minutes to the Varnish in steroids world, I really appreciate it.  I'd like to share this snippet which might be very interesting for you if you are new to the Varnish magic too.

This has been my first contact with Varnish ever, and I have to say I am quite amazed on how the application is responding now in terms...


Simple Varnish Installation

The first thing to do is to make sure your application is passing the headers properly. At least you'll need this (in PHP):

// Let's say Varnish caches for 12 hours:
$cache_max_age = 60*60*12;
header( "Cache-Control: public, must-revalidate, max-age=0, s-maxage=$cache_max_age" ); 

Varnish installation (CentOS/Redhat): RPM taken from...