Environment Variables

Monolithic and Generic’s behaviour is controlled by a wide variety of environment variables. They are detailed here along with the default values.

Changing Environment Variables

Recreating is ok

Changing environment variables in docker requires you to delete and recreate your containers. Don't worry, your cache data is safely stored OUTSIDE in a volume and will be reused by the new containers

If you are using docker-compose these variables can be changed by editing the .env file provided. If a specific variable does not exist in your version of the .env just add a new line.

If you are using docker from the command line environment variables are specified using -e VARIABLE=VALUE format when you launch the container.

General Settings

Variable Description

CACHE_DOMAINS_REPO

The github repo url for the cache_domains files to use to populate the cdn maps, if you do not want to use the recommended source for testing purposes.

Default:  https://github.com/uklans/cache-domains.git

CACHE_DOMAINS_BRANCH

The branch of the CACHE_DOMAINS_REPO to use

Default:  master

NOFETCH

Turn off all git pull operations and use stored data

Default:  false

UPSTREAM_DNS

The upstream DNS server(s) the cache should use. The defaults are Google DNS. Multiple upstream dns servers are allowed, separated by semi colons (or spaces). Do NOT point this at lancache-dns.

Default:  8.8.8.8 8.8.4.4

CACHE_DISK_SIZE

The amount of disk space the container should use for caching data. Specified in gigabytes.

Default:  1000g

CACHE_INDEX_SIZE

Amount of index memory for the nginx cache manager. We recommend 250m of index memory per 1TB of CACHE_DISK_SIZE

Default:  500m

CACHE_MAX_AGE

The maximum amount of time a file should be held in cache. There is usually no reason to reduce this - the cache will automatically remove the oldest content if it needs the space.

Default:  3560d

MIN_FREE_DISK

Sets the minimum free disk space that must be kept at all times. When the available free space drops below the set amount for any reason, the cache server will begin pruning content to free up space. Specified in gigabytes.

Default:  10g

Advanced Settings

HERE BE DRAGONS!!!

These settings really aren't meant to be changed very often, it is highly unlikely you want to change them unless it's been recommended by a team member or you REALLY know what you are doing

Variable Description

NGINX_WORKER_PROCESSES

Default:  auto

GENERICCACHE_VERSION

Internal reference version. DO NOT CHANGE THIS.

Default:  2

WEBUSER

Account NGINX runs under

Default:  www-data

BEAT_TIME

How often the internal heart beat process runs

Default:  1h

LOGFILE_RETENTION

Default:  3560

NGINX_WORKER_PROCESSES

Default:  16

CACHE_SLICE_SIZE

See this guide before changing this. It WILL invalidate any currently cached data.

Default:  1m

CACHE_MODE

Default:  generic

FORCE_PERMS_CHECK

Force a full permissions check on startup. When the container starts up normally, it checks a few key locations to ensure that they are owned by the correct user. This option will force the container to do a full check of all cache directories and files. THIS WILL BE VERY SLOW, AND MAY POSSIBLY TAKE HOURS.

Default:  false