Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CACHE_ENABLED="false" is not respected when CACHE_STORE="redis" #11029

Closed
3 tasks done
rc1 opened this issue Jan 13, 2022 · 6 comments
Closed
3 tasks done

CACHE_ENABLED="false" is not respected when CACHE_STORE="redis" #11029

rc1 opened this issue Jan 13, 2022 · 6 comments

Comments

@rc1
Copy link

rc1 commented Jan 13, 2022

Preflight Checklist

Describe the Bug

I was following the docker installation guide by using the docker compose example.

However, I didn't want to use Redis. I removed the redis container and set the CACHE_ENABLED: 'false'.

The guide states:

      CACHE_ENABLED: 'true'
      CACHE_STORE: 'redis'
      CACHE_REDIS: 'redis://cache:6379'

But I changes this to

      CACHE_ENABLED: 'false' # changes here
      CACHE_STORE: 'redis'
      CACHE_REDIS: 'redis://cache:6379'

On running the compose file, errors about the cache were presented.

To Reproduce

Copy the docker compose example from here.

Comment out these lines:

  cache:
    container_name: cache
    image: redis:6
    networks:
      - directus

Set this environment variable to 'false':

CACHE_ENABLED: 'true'

Errors Shown

[cache] Error: getaddrinfo ENOTFOUND cache

What version of Directus are you using?

directus/directus:latest (9.4.3)

What version of Node.js are you using?

Same as official the docker image

What database are you using?

Postgres

What browser are you using?

n/a

What operating system are you using?

n/a

How are you deploying Directus?

docker

@rijkvanzanten
Copy link
Member

Can you try it with

 CACHE_ENABLED: false

instead of

 CACHE_ENABLED: 'false'

?

@rijkvanzanten
Copy link
Member

I believe this is a configuration problem, rather than a bug. The system cache will also rely on the configured cache driver, so make sure to set CACHE_SCHEMA=false
CACHE_PERMISSIONS=false as well as CACHE_ENABLED=false if you want to disable all caches 👍🏻

@rc1
Copy link
Author

rc1 commented Apr 7, 2022

It would be helpful if the guide used

=true

Instead of

='true'

So to prevent people getting tripped up like myself.

Minor nit on a great system, thanks.

@rijkvanzanten
Copy link
Member

Those two should be parsed the same in directus' env var casting 👍🏻 I believe my other comment is the source of your confusion 🙂

@Rar9
Copy link

Rar9 commented Sep 19, 2022

The redis cache should be updated when something gets added /deleted

@azrikahar
Copy link
Contributor

The redis cache should be updated when something gets added /deleted

This behavior can be enabled via the CACHE_AUTO_PURGE environment variable 🙂 Link to docs: https://docs.directus.io/self-hosted/config-options.html#cache

Let's do keep comments on topic and opt to create a new discussion/question when possible.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants