Redis
Redis is used to store the download counter data. If the download counter is disabled, Redis will not be loaded/started at all.
Access
Sometimes it is useful to access the Redis instance directly e.g. for resetting a counter. This can be done using the redis-cli
tool inside the container.
- First create a shell. Replace
<name>
with the name of the container.
docker exec -it <name> sh
- Start the Redis CLI.
redis-cli
See https://redis.io/docs/latest/commands/ for a list of available commands.
List all stored counters
$> KEYS *
...
25) "/src/index.php"
26) "/docs/versioned_docs/version-1.x/configuration/download-count.md"
27) "/docs/static/img/pw1.png"
28) "/docs/versioned_docs/version-1.x/development/_category_.json"
29) "/docs/versioned_docs/version-1.x/getting-started/installation.md"
30) "/docs/static/img/cerulean_dark.png"
31) "/docs/versioned_sidebars/version-1.x-sidebars.json"
32) "/docs/versioned_docs/version-2.x/configuration/highlight-updated.md"
33) "/docs/static/img/secure.svg"
34) "/docs/src/pages/index.module.css"
...
Read a counter
$> GET /src/index.php
123
Reset/Modify a counter
$> SET /src/index.php 0
OK