Merlin
Merlin

Reputation: 97

Ignore specific request's headers on Frontend so the requests don't get cached

I'm working with Feature Flags (Azure App Configuration) and on the React side I have followed this guide indicating how to consume the info.

However, the responses of the GET requests being made to obtain the features' info are being cached in the browser, which doesn't let me display the true current status of the features.

I've been told that there isn't any way to configure this on the Azure side, so the only solution would be to ignore the Expires: or Cache-Control: max-age headers.

Is there any way to do this from a frontend view? I'm working with React.

Thanks in advance!

Upvotes: 0

Views: 86

Answers (1)

Zhenlan Wang
Zhenlan Wang

Reputation: 1543

@Merlin, it is not recommended to use the connection string in a client react app. Here is the recommendation from the Azure App Configuration service. You can also have better control of the caching behavior that way.

https://learn.microsoft.com/en-us/azure/azure-app-configuration/howto-best-practices#client-applications-in-app-configuration

Upvotes: 1

Related Questions