So I am new to Aurelia and web development in general.
Currently I have a view with a table of data. After editing an entry and returning to the table I call my function to make another API call but instead my browser returns a 304 not modified (though in the database the values have been updated).
When I enable "always refresh from server" in Edge I get the results as I would expect. Is there some way of telling this Http request to always call the API and not from the cache?
Off the top of my head, you could alter the url you're hitting to have some junk at the end of it.
this.http.get(url + "?_t=" + new Date().getTime(), data).done(function(values) {
//do stuff
});
Not pretty, but it should work.
Similarly, you could construct your own call to use.
nonCachedGet(url, data) {
return this.http.createRequest(url)
.asGet()
.withContent(data)
.withParams({ _t: new Date().getTime() })
.send();
}
It doesn't look like there are any specific settings telling the built in request methods not to cache, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With