Prevent IE11 caching GET call in Angular 2

前端 未结 7 660
甜味超标
甜味超标 2020-11-28 09:19

I have a rest endpoint that returns a list on a GET call. I also have a POST endpoint to add new items and a DELETE to remove them. This works in Firefox and Chrome, and the

7条回答
  •  再見小時候
    2020-11-28 09:41

    Forward the stackoverflow response Angular IE Caching issue for $http, you should add the headers 'Pragma', 'no-cache', 'If-Modified-Since' to each 'GET' request.

    The interceptor's scenario is not supported to angular 2 anymore. So you should extend the http as it is described here What is httpinterceptor equivalent in angular2?.

    Angular 4.3 now includes the HttpClient service, which supports interceptors.

提交回复
热议问题