Notification texts go here Contact Us Buy Now!

Directus Api GET doesn't show changes instantly

Issue: Directus API GET requests may not reflect changes made to the data immediately, resulting in outdated or inaccurate information being displayed.

Possible Cause: Caching is enabled in Directus, which can cause a delay in the propagation of changes.

Solution 1: Disable Redis Caching:

If you're using Redis for caching, disable it by setting the CACHE_ENABLED environment variable to false. This will ensure that changes are reflected immediately in API responses.
CACHE_ENABLED = false

Solution 2: Enable Automatic Cache Purging:

Set the CACHE_AUTO_PURGE environment variable to true. This will cause Directus to automatically purge the cache whenever data is modified, ensuring that API responses always contain the latest information.
CACHE_AUTO_PURGE = true

Explanation:

Directus uses caching to improve performance by storing frequently requested data in memory. However, this can lead to a delay in the propagation of changes if the cache is not properly configured. Disabling caching or enabling automatic cache purging ensures that API responses always reflect the most up-to-date data.

Additional Information:

  • Refer to the Directus documentation for more details on caching configuration: Directus Docs
  • Restart Directus after making changes to the environment variables for the changes to take effect.

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.