This project lets you explore how Varnish Cache reacts to HTTP headers.
git clone https://github.com/hilverd/http-cache-playground.git
cd http-cache-playground
docker compose up
Then open http://localhost:8080/.
You can change the Varnish configuration by editing default.vcl and restarting the varnish container.
To add support for purging you will need to
- edit the Varnish configuration as described above,
- set
showButtonForAddingPurgeRequestSteptoTrueinConfig.elm, and - use
docker compose -f docker-compose-dev.yml up --buildto recompile and run the project.
I haven't tried this yet, but in principle you should be able to use a different cache (nginx maybe?) as follows.
- Modify
docker-compose-dev.ymlto use something other than thevarnishimage, - change
originHostinserver.js, and - use
docker compose -f docker-compose-dev.yml up --buildto recompile and run the project.
See also the backend default section in default.vcl.
This project is not affiliated with Varnish Software or its related projects.
This project is mainly written in Elm. The UI is based on components from daisyUI.