Skip to content

hilverd/http-cache-playground

Repository files navigation

A merry-go-round with a hard disk drive at the bottom

HTTP Cache Playground

This project lets you explore how Varnish Cache reacts to HTTP headers.

Getting Started

git clone https://github.com/hilverd/http-cache-playground.git
cd http-cache-playground
docker compose up

Then open http://localhost:8080/.

Changing the Varnish configuration

You can change the Varnish configuration by editing default.vcl and restarting the varnish container.

Adding support for purging

To add support for purging you will need to

  1. edit the Varnish configuration as described above,
  2. set showButtonForAddingPurgeRequestStep to True in Config.elm, and
  3. use docker compose -f docker-compose-dev.yml up --build to recompile and run the project.

Using a different HTTP cache

I haven't tried this yet, but in principle you should be able to use a different cache (nginx maybe?) as follows.

  1. Modify docker-compose-dev.yml to use something other than the varnish image,
  2. change originHost in server.js, and
  3. 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.

Disclaimer

This project is not affiliated with Varnish Software or its related projects.

Acknowledgments

This project is mainly written in Elm. The UI is based on components from daisyUI.

About

Explore how Varnish Cache reacts to HTTP headers.

Resources

License

Stars

Watchers

Forks