【问题标题】:How to clear in AngularJs server cache and cookies?如何清除 AngularJs 服务器缓存和 cookie?
【发布时间】:2017-06-25 15:58:59
【问题描述】:

我在我的网站上使用 AngularJS。更新我的内容并将其托管在服务器上后,它仅显示以前的内容。我清除了浏览器历史记录和 cookie,但它仍然只显示旧内容。我在 .htaccess 文件 ExpiresByType 中设置为最小值,例如 0 秒、1 秒,但仍然只显示旧内容。在 Hostgator.in 中,我有一个演示服务器,用于上传网站。新内容显示。但是在 hostgater.com 我有我的官方服务器。我上传了新内容,但没有显示。

请帮帮我。

【问题讨论】:

标签: javascript html css angularjs .htaccess


【解决方案1】:

在你的路由文件中使用cache:false 并使用

$ionicHistory.clearCache();
$ionicHistory.clearHistory();

在 controller.js 文件中我希望这能解决你的问题。

【讨论】:

  • $scope.clear= function () { $ionicHistory.clearCache(); $ionicHistory.clearHistory(); $timeout(function () { }, 200) } }) 在你的 controllers.js 中使用这个函数
猜你喜欢
  • 2021-07-14
  • 2013-05-08
  • 2017-08-26
  • 2018-11-17
  • 2019-01-01
  • 2016-07-11
  • 2017-04-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多