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

Ocelot Cache - How do we Cache only success(200) response from micro services via API Gateway #353

Open
chitharansivasamy opened this issue Jul 19, 2021 · 1 comment

Comments

@chitharansivasamy
Copy link

The problem is we had used the below Ocelot JSON to cache the response and it's holding the data for one full day (86400 secs). here is suppose to get some errors during the services call like(500,502,499...). what happened is the cached error response was not even updated till one full day even the services issue got resolved.

"UpstreamPathTemplate": "/Products/GetProductMetaData",
"UpstreamhttpsMethod": [ "GET" ],
"FileCacheOptions": { "TtlSeconds": 86400 },

So we are looking for the gateway to cache only success and not the failure cases. It should be hit services till when its bring success(200).
Is there any option in OCELOT to restrict caching based on the HTTP Status code like 500, 502, 503, 499..etc?

@MichaCo
Copy link
Owner

MichaCo commented Jul 19, 2021

You'd have to post/ask that in the Ocelot repository I think. I have no idea ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants