Coder Social home page Coder Social logo

service-varnish's Introduction

Varnish Docker images for Docksal

Varnish is an HTTP accelerator designed for content-heavy dynamic web sites as well as APIs.

This image(s) is part of the Docksal image library.

Versions

  • docksal/varnish:4.1 (docksal/varnish:4.1-2.0)
  • docksal/varnish:6.0 (docksal/varnish:6.0-2.0)
  • docksal/varnish:6.1 (docksal/varnish:6.1-2.0, docksal/varnish:latest)

Image tag scheme: <software-version>[-<image-stability-tag>][-<flavor>]

Features

  • Cache flushing using PURGE (individual pages) and BAN (cache tag based) requests
  • VCL config settings via environment variables, as well as custom VCL config support
  • BigPipe support

Environmental variables

  • VARNISH_PORT - port Varnish binds to, default: 80
  • VARNISH_BACKEND_HOST - backed-end IP/host, default: web
  • VARNISH_BACKEND_PORT - backed-end port, default: 80
  • VARNISH_CACHE_SIZE - cache size, default: 64M
  • VARNISH_VARNISHD_PARAMS - extra parameters for varnishd.
  • VARNISH_VARNISHNCSA_PARAMS - parameters for varnishncsa (logging).
  • VARNISH_SECRET - allow the secret to be set for varnish.
  • VARNISH_CACHE_TAGS_HEADER - Varnish cache header name for BAN's, default: Cache-Tags

Cache flushing

PURGE

Cache for a specific URL can be flushed using the PURGE HTTP method, example:

curl -X PURGE http://varnish.tests.docksal/node/1

BAN

Cache for a group of URLs can be flushed using the BAN HTTP method by passing a list of tags via a specific header.

The application has to provide the cache tags header value(s) in the response (e.g. Cache-Tags: node:1 term:2). These tags are then used to ban pages from Varnish cache (usually handled by the application using a module/library).

By default, Cache-Tags is used as the header to pass cache tags. The header name can be overridden via the VARNISH_CACHE_TAGS_HEADER environment variable.

Depending your application environment VARNISH_CACHE_TAGS_HEADER may need to be set to:

Using BAN to manually flush cache by tag:

curl -X BAN http://varnish.tests.docksal/ -H "Cache-Tags: node:1"

VCL

To provide a custom VCL config mount it at /opt/default.vcl.

When used with Docksal, custom VCL is automatically loaded from .docksal/etc/varnish/default.vcl if one exists in the project codebase.

service-varnish's People

Contributors

christianwiedemann avatar lmakarov avatar sean-e-dietrich avatar sergey-zabolotny avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.