简体   繁体   中英

How can I configure apigee to fail stale if the backend is unavialble?

We have an API proxy configured with cache ttl of 2mins. Is it possible to configure apigee to serve stale cached content if the backend goes down so that our end users don't see errors?

We would rather have our end users get copies of stale cached content (even after the configured ttl of 2mins expires) instead of errors when the backend goes down.

Would appreciate if someone could point me to the relevant documentation if this is possible.

Options i can think of is to

  1. handle the specific error code using Target Endpoint properties to not consider the error code as error and have a flow serve the cached data.

  2. use fault flows to deal with error and have the fault flow serve the required data.

Once the cache TTL expires the cached data is no longer accessible, even as "stale" data. You can consider using something like Apigee BaaS to store data as a "cache" with an appropriate TTL so that if the back-end is up you can serve the last-retrieved data from BaaS, or you can extend your cache TTL so that the data remains available even if the back end is down.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM