I'm writing an Angular SPA app, that uses HttpClient to get values from my backend.
What is the easy way to tell it not to cache? The first time I ask it gets the value, then it refuses to make subsequent queries.
Thanks, Gerry
<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0">
<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
or,
Add headers
in http
request as:-
headers = new Headers({
'Cache-Control': 'no-cache, no-store, must-revalidate, post-
check=0, pre-check=0',
'Pragma': 'no-cache',
'Expires': '0'
});