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
showButtonForAddingPurgeRequestStep
toTrue
inConfig.elm
, and - use
docker compose -f docker-compose-dev.yml up --build
to 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.yml
to use something other than thevarnish
image, - change
originHost
inserver.js
, and - use
docker compose -f docker-compose-dev.yml up --build
to 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.