나는 angularjs 및 부트 스트랩을 사용하는 웹 사이트를 운영합니다. 문제는 클라이언트 브라우저의 캐시에 있습니다. 나는 뭔가를 게시 ... 클라이언트가 캐시에서 오래된 물건을 얻을. 나는 라우팅을 위해 angle-ui-router-0.3.1을 사용하고 있습니다.캐시 경로 페이지 사용 안 함
$ stateProvider에서 cache : false를 사용하고 있지만 아무것도 사용하지 않습니다.
<!DOCTYPE html>
<html lang="en" ng-app="mainApp">
<head>
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache, must-revalidate, post-check=0, pre-check=0">
<meta http-equiv="pragma" content="no-cache">
...
</head>
<body>
<div ui-view></div>
</body>
</html>
과 app.js : 내가 프리젠 테이션 페이지를 업데이트 할 때
var app = angular.module('mainApp', ['ui.router','angularUtils.directives.dirPagination']);
app.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('index', {
cache: false,
url: '/',
templateUrl: 'pages/main.html'
})
.state('presentation', {
cache: false,
url: '/presentation',
templateUrl: 'pages/presentation.html'
})
.state('about', {
cache: false,
url: '/about',
templateUrl: 'pages/about.html'
})
...
$urlRouterProvider.otherwise('/');
});
큰 문제는, 예를 들면 다음
내가 경로 HTML 페이지에 사용하는 인덱스입니다 클라이언트는 업데이트를 얻지 못합니다.경로 페이지가 캐시에 저장되어 있어도 강제로로드해야합니까? 아니면 어떻게 클라이언트 브라우저, 경로 페이지를 캐시하지 말합니?
... 캐시가있는 경우 : 당신은 또한 메인 페이지의 새로 고침을 강제하려면, 여기에 모든 브라우저를 만족하기위한 최소 요구 사항은 버전 1.9이고 서버에서 버전 1.13은 캐시 버전 1.9를로드합니다. 왜??? – calin24
메인 페이지가 다시로드되고 브라우저가 최신 버전을 볼 수 있도록'meta' 태그를 사용해야합니다. 처음으로'meta' 태그를 추가하는 경우 먼저 한번 새로 고쳐야 할 수도 있습니다. – sh0ber