1

나는 메타 태그 방법에 대한 또한, 전체 루비 레일 MVC 웹 사이트 나는 다음과 같은 방법을 발견ROR + MVC 안 브라우저 캐시

위해 브라우저 캐시를 해제하는 방법에 대한

Response.Cache.SetExpires(DateTime.Now.AddSeconds(5)); 
Response.Cache.SetCacheability(HttpCacheability.Public); 
Response.Cache.SetValidUntilExpires(true); 

을보고하고있다.

<meta http-equiv="PRAGMA" content="NO-CACHE"> 

하지만 난이 간단한 방법을 찾고는 전체 웹 사이트에 대한 브라우저 캐시를 비활성화합니다.

+0

대답은 아래와 같습니다! – Rubyist

답변

1

친구, Google에서 긴 검색 후. 나는 이것을위한 하나의 해결책을 가지고있다. 나도 잘 모르겠다. 하지만 내 문제가 해결되었습니다.

application_controller.rb에서 코드 아래에있는 추가 ..

before_filter :set_cache_buster 

    def set_cache_buster 
    response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate" 
    response.headers["Pragma"] = "no-cache" 
    response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" 
    end 

는 위 질문에 대한 감사 Goooooogle

관련 문제