how to clear browser cache in reactjs

For this specific case what you can do is to tell the browser not to cache your page, by using below meta tags inside <head> tag: This is temporary solution and for permanent solution, you should handle this using appropriate headers sent by your API/backend.

<meta http-equiv='cache-control' content="no-cache">
<meta http-equiv='expires' content="0">
<meta http-equiv='pragma' content="no-cache">

To handle this using API/backend, you should send the appropriate headers with your resource from your back end. And again if you are trying to disable cache temporally you can do it by disabling browser cache. To do so, Follow below steps.

In your developer tools. Find network tab and disable cache. Like here in the image.

enter image description here

Hope this resolves.

Headers for caching:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)