---
title: Charmhub | Deploy Content Cache using Charmhub - The Open Operator Collection
description: Deploy the latest version of Content Cache on any cloud.
url: https://charmhub.io/content-cache/configurations
---

# Content Cache

[Canonical IS DevOps](https://charmhub.io/publisher/canonical-is-devops "View all packages from Canonical IS DevOps")

* [Canonical IS DevOps](https://charmhub.io/publisher/canonical-is-devops "View all packages from Canonical IS DevOps")
* [Monitoring](https://charmhub.io/?filter=monitoring)
* [Networking](https://charmhub.io/?filter=networking)

Platform:

24.04

22.04

20.04

18.04

stable 4b9222c

```
juju deploy content-cache
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

* [blacklist\_ports](https://charmhub.io/content-cache/configurations#blacklist_ports)
* [blocked\_ips](https://charmhub.io/content-cache/configurations#blocked_ips)
* [cache\_inactive\_time](https://charmhub.io/content-cache/configurations#cache_inactive_time)
* [cache\_max\_size](https://charmhub.io/content-cache/configurations#cache_max_size)
* [cache\_path](https://charmhub.io/content-cache/configurations#cache_path)
* [enable\_cache\_background\_update](https://charmhub.io/content-cache/configurations#enable_cache_background_update)
* [enable\_cache\_lock](https://charmhub.io/content-cache/configurations#enable_cache_lock)
* [enable\_firewalling](https://charmhub.io/content-cache/configurations#enable_firewalling)
* [enable\_prometheus\_metrics](https://charmhub.io/content-cache/configurations#enable_prometheus_metrics)
* [extra\_packages](https://charmhub.io/content-cache/configurations#extra_packages)
* [haproxy\_extra\_configs](https://charmhub.io/content-cache/configurations#haproxy_extra_configs)
* [haproxy\_hard\_stop\_after](https://charmhub.io/content-cache/configurations#haproxy_hard_stop_after)
* [haproxy\_load\_balancing\_algorithm](https://charmhub.io/content-cache/configurations#haproxy_load_balancing_algorithm)
* [haproxy\_processes](https://charmhub.io/content-cache/configurations#haproxy_processes)
* [haproxy\_threads](https://charmhub.io/content-cache/configurations#haproxy_threads)
* [install\_keys](https://charmhub.io/content-cache/configurations#install_keys)
* [install\_sources](https://charmhub.io/content-cache/configurations#install_sources)
* [log\_retention](https://charmhub.io/content-cache/configurations#log_retention)
* [max\_connections](https://charmhub.io/content-cache/configurations#max_connections)
* [metrics\_listen\_address](https://charmhub.io/content-cache/configurations#metrics_listen_address)
* [nagios\_context](https://charmhub.io/content-cache/configurations#nagios_context)
* [nagios\_servicegroups](https://charmhub.io/content-cache/configurations#nagios_servicegroups)
* [package\_status](https://charmhub.io/content-cache/configurations#package_status)
* [reuseport](https://charmhub.io/content-cache/configurations#reuseport)
* [sites](https://charmhub.io/content-cache/configurations#sites)
* [sites\_secrets](https://charmhub.io/content-cache/configurations#sites_secrets)
* [tls\_cipher\_suites](https://charmhub.io/content-cache/configurations#tls_cipher_suites)
* [tune\_nf\_conntrack\_max](https://charmhub.io/content-cache/configurations#tune_nf_conntrack_max)
* [tune\_tcp\_mem\_multiplier](https://charmhub.io/content-cache/configurations#tune_tcp_mem_multiplier)
* [worker\_connections](https://charmhub.io/content-cache/configurations#worker_connections)
* [worker\_processes](https://charmhub.io/content-cache/configurations#worker_processes)

[Learn about configurations >](https://juju.is/docs/juju/configuration#heading--application-configuration)

* blacklist\_ports | string

  Default: 8094

  Comma-separated list of TCP port numbers to skip over when generating internal servers used between haproxy and nginx. Used when a large number of sites may interfere with existing unit services, subordinate charms, etc.
* blocked\_ips | string

  A list of IPs or IP ranges to be denied from the service. Accept plain and CIDR IPv4 and IPv6 addresses. IP addresses can have any number of leading and trailing whitespace characters and are separated by comma.
* cache\_inactive\_time | string

  Maximum age/time inactive objects are stored in cache. If unspecified, use the upstream defaults (currently 10m).
* cache\_max\_size | string

  Maximum size of content cache storage. If unspecified, the maximum cache storage size will be set to 75% of the total disk space, using a 1GB minimum size.
* cache\_path | string

  Default: /var/lib/nginx/proxy

  Path or directory to store cached objects.
* enable\_cache\_background\_update | boolean

  Default: True

  Default is to enable serving contents from the cache with a background subrequest to update objects in cache. This works for large objects, but can cause issues with sites updated recently to redirect and still have objects in the cache.
* enable\_cache\_lock | boolean

  Default: True

  Default is to restrict to only one request at a time to populate new cache elements from the backends. See Nginx' proxy\_cache\_lock.
* enable\_firewalling | boolean

  Default: True

  Enable firewalling (currently ufw) for blocking IPs.
* enable\_prometheus\_metrics | boolean

  Export metrics for the number of requests and the number of cache hits. Prometheus metrics are exposed at /metrics on localhost:9145.
  NOTE: This breaks on Jammy and above due to LUA no longer supported - LP:1262710
* extra\_packages | string

  Space separated list of extra deb packages to install.
* haproxy\_extra\_configs | string

  Extra configs for HAproxy. Use at your own risk.
* haproxy\_hard\_stop\_after | string

  Default: 5m

  Tune HAProxy's hard-stop-after to prevent lingering HAProxy processes (LP:1874386).
* haproxy\_load\_balancing\_algorithm | string

  Default: leastconn

  Change the load balancing algorithm used by HAProxy for the backends.
* haproxy\_processes | int

  Sets the number of HAProxy processes. If both processs and threads specified and using HAProxy 2.x and above, the number of HAProxy threads will be configured using processes multiplied by threads (max. 64).
* haproxy\_threads | int

  Sets the number of HAProxy threads. If both processs and threads specified and using HAProxy 2.x and above, the number of HAProxy threads will be configured using processes multiplied by threads (max. 64).
* install\_keys | string

  List of signing keys for install\_sources package sources, per charmhelpers standard format (a yaml list of strings encoded as a string). The keys should be the full ASCII armoured GPG public keys. While GPG key ids are also supported and looked up on a keyserver, operators should be aware that this mechanism is insecure. null can be used if a standard package signing key is used that will already be installed on the machine, and for PPA sources where the package signing key is securely retrieved from Launchpad.
* install\_sources | string

  List of extra apt sources, per charm-helpers standard format (a yaml list of strings encoded as a string). Each source may be either a line that can be added directly to sources.list(5), or in the form ppa:<user>/<ppa-name> for adding Personal Package Archives, or a distribution component to enable.
* log\_retention | int

  Default: 30

  Number of log files to retain during rotation.
* max\_connections | int

  Configure maximum number of connections per site on frontend HAProxy. Defaults to auto-calculate (0).
* metrics\_listen\_address | string

  Default: localhost

  Restrict exposed metrics to listen on certain addresses.
* nagios\_context | string

  Default: juju

  This string is prefixed to the hostname when writing exported nagios config fragments.
* nagios\_servicegroups | string

  A comma-separated list of nagios servicegroups. If left empty, the nagios\_context will be used as the servicegroup
* package\_status | string

  Default: install

  The status of service-affecting packages will be set to this value in the dpkg database. Valid values are "install" and "hold".
* reuseport | boolean

  Use the SO\_REUSEPORT socket option, allowing a better load balance on the nginx workers. Can result in performance drop due to increased latency on heavy workload. See https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1/.
* sites | string

  Default: content-cache:
  locations:
  /:
  backends:
  - archive.ubuntu.com:80

  YAML-formatted virtual hosts/sites. See https://charmhub.io/content-cache/docs/sites-configuration for more details and examples.
* sites\_secrets | string

  YAML-formatted dictionary of secrets/keys. e.g. site1.local:
  locations:
  "/":
  backend-path: /my-backend-path-secret/
  origin-headers:
  X-Origin-Key: my-origin-secret-key
  signed-url-hmac-key: my-signed-url-secret-key
  See https://charmhub.io/content-cache/docs/sites-secrets-configuration for more details and examples.
* tls\_cipher\_suites | string

  Override default ciphers used for TLS/SSL termination (OpenSSL format).
* tune\_nf\_conntrack\_max | int

  Tune or set net.nf\_conntrack\_max. Set to 0 to disable.
* tune\_tcp\_mem\_multiplier | float

  Default: 1.5

  Tune net.ipv4.tcp\_mem, apply multiplier.
* worker\_connections | int

  Default: 768

  Sets the maximum number of simultaneous connections that can be opened by an Nginx worker process.
* worker\_processes | int

  Sets the number of Nginx worker processes. Setting to '0' (auto) will set based on available CPU cores.
