Read-only mirror of https://github.com/SwissFederalArchives/lindas-varnish-post — Schweizerisches Bundesarchiv. Issues & pull requests at the source.
  • Shell 60.1%
  • Dockerfile 16.6%
  • VCL 11.9%
  • TypeScript 10.2%
  • JavaScript 1.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-03-26 12:05:00 +01:00
.changeset Upgrade Varnish from 7.1 (EOL) to 7.6 for security patch support 2026-02-12 10:11:21 +01:00
.github ci: re-enable auto-deploy to TEST [skip ci] 2026-03-26 12:05:00 +01:00
config feat: also hash the Accept header 2025-08-05 10:45:39 +02:00
test build(deps-dev): bump @types/node from 24.5.2 to 24.6.2 in /test/app 2025-10-06 12:13:50 +00:00
.dockerignore ci: configure Changesets 2024-04-23 15:46:28 +02:00
.editorconfig initial commit 2021-06-16 12:15:10 +02:00
.gitignore chore: ignore root package-lock.json 2024-06-25 08:59:42 +02:00
CHANGELOG.md Standardize Docker image tag naming 2026-02-17 12:17:35 +01:00
Dockerfile Upgrade Varnish from 7.1 (EOL) to 7.6 for security patch support 2026-02-12 10:11:21 +01:00
entrypoint.sh Fix security vulnerability and Windows line ending issues 2025-12-10 19:51:30 +01:00
LICENSE chore: remove year in the license 2024-04-23 14:33:11 +02:00
package-lock.json Upgrade Varnish from 7.1 (EOL) to 7.6 for security patch support 2026-02-12 10:11:21 +01:00
package.json Upgrade Varnish from 7.1 (EOL) to 7.6 for security patch support 2026-02-12 10:11:21 +01:00
README.md feat: add CUSTOM_ARGS support 2024-12-23 14:32:32 +01:00

Varnish POST

This Docker image let you cache GET and POST requests.

For POST requests, it will not cache requests with no body or with an empty body.

Docker image

You can pull the Docker image using:

docker pull ghcr.io/zazuko/varnish-post

It is listening on the 80 port.

Configuration

You can use following environment variables for configuration:

  • BACKEND_HOST: host of the backend to cache (default: localhost)
  • BACKEND_PORT: port of the backend to cache (default: 3000)
  • VARNISH_SIZE: size of the cache in the RAM (default: 100M)
  • BACKEND_FIRST_BYTE_TIMEOUT: first byte timeout (default: 60s)
  • CACHE_TTL: time to cache the request (default: 3600s)
  • BODY_SIZE: maximum size for the body ; if it exceeds this value, it will not be cached (default: 2048KB)
  • DISABLE_ERROR_CACHING: disable the caching of errors (default: true)
  • DISABLE_ERROR_CACHING_TTL: time where requests should be directly sent to the backend after an error occured (default: 30s)
  • CONFIG_FILE: the name of the configuration file to use (default: default.vcl)
  • ENABLE_LOGS: enable logs (default: true)
  • ENABLE_PROMETHEUS_EXPORTER: enable the Prometheus exporter if set to true (default: false). If enabled, the exporter will be available on the 9131 port.
  • PURGE_ACL: custom ACL for the PURGE method (default: localhost) ; you can use 0.0.0.0/0 to allow all.
  • CUSTOM_ARGS: custom arguments to pass to varnishd (default: '')

Cache invalidation

You can invalidate the cache entry by sending the same request with the PURGE method.

If your backend is sending a xkey header, if you send a PURGE request with the same xkey header, it will invalidate all cache entries with the same tag.

License

This project is licensed under the MIT License. See the LICENSE file for details.