Have you used varnishtest? Maybe not, but we’ve just made it a lot easier for you to adopt and put into practice!
Varnish includes varnishtest, a test-driver script program, and has since Varnish 2 was introduced back in 2008. varnishtest allows you to:
- test the configuration of your actual Varnish server
- create client mock-ups
- simulate transactions
- fetch content from simulated or real backends
- assert expected behaviors
- create use cases to reproduce and report bugs
Users and developers can benefit from varnishtestvarnishtest has proven to be very useful for:
- system administrators when writing complex VCL programs or tuning Varnish
- web developers when writing applications that aim to take full advantage of Varnish
- VMOD developers when defining and testing their modules
However, the use of varnishtest has not been widespread mainly because of its lack of documentation. Therefore, we have now included varnishtest throughout The Varnish Book.
varnishtest in The Varnish Book
The Varnish Book uses varnishtest as testbed alternative to help you understand the behavior of Varnish. The book teaches you the Varnish Test Case (VTC) language and how to run your tests.
The introduction of varnishtest in the book is useful to clarify the use of different cache-related HTTP header fields and the difference among techniques that could be used to achieve a required behavior. For example, the usage of the Vary HTTP header field and hash_data() function to cache content with cookies and how to invalidate such caches. Well- understood behaviors of cache-related header fields and Varnish gives you strong foundations to configure your Varnish server efficiently and develop your own VMODs when needed.
All of this and more is waiting for you in the latest version of The Varnish Book.