Notification texts go here Contact Us Buy Now!

Directus Api GET doesn't show changes instantly

Issue: Directus API GET Doesn't Show Changes Instantly

Possible Causes:

  • Redis Caching:
  • If you're using Redis for caching, it can delay the visibility of changes made through the API. To disable Redis caching, set the CACHE_ENABLED environment variable to false.
  • Cache Settings:
  • Directus has cache settings that can affect the visibility of changes. By default, CACHE_AUTO_PURGE is set to false, which means changes will be cached for 5 minutes before they're reflected in API responses. To ensure instant visibility of changes, set CACHE_AUTO_PURGE to true.

Solutions:

  • Disable Redis Caching:
  • Open your .env file and add the following line:CACHE_ENABLED = false

Adjust Cache Settings: Open your .env file and add the following line:CACHE_AUTO_PURGE = true

Explanation:

Redis caching can improve performance by storing frequently requested data in memory for faster retrieval. However, if you need to see changes immediately after making them through the API, you'll need to disable Redis caching.

The CACHE_AUTO_PURGE setting controls how Directus handles caching for data manipulation actions. When set to false, changes are cached for 5 minutes before they're reflected in API responses. Setting it to true ensures that changes are always reflected immediately.

By adjusting these settings, you can ensure that changes made through the Directus API are reflected instantly in subsequent API requests.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.