在 angularjs 中是否默认启用缓存?

Is Caching enable by default in angularjs?

我是 angularjs 的新手,根据此 documentation 在 $http 服务中使用缓存,我们最多将此选项添加到配置中:

$http({
    method : "GET",
    url : "somehost/somepath",
    cache : true
}) ; 

表示默认情况下禁用缓存,但在现实世界中,当我使用此配置时:

  $http({
    method : "GET",
    url : "somehost/somepath"
}) ; 

我看到这个结果:

如何关闭这个缓存系统?

这是浏览器缓存,浏览器缓存的结果不是AngularJS,这是HTTP protocol允许的。您可以控制在应用程序后端缓存的内容和数量。

处理文件缓存的典型方法是版本控制(或 "revving" 它们),如果文件具有不同的 URL 浏览器将不会从其缓存中加载它。