티스토리 뷰

웹프로그래밍

Clear cache 캐시 클리어

공허공자 2021. 12. 16. 23:54

HTML

<head>
  <meta http-equiv="Cache-Control" content="no-cache"/>
  <meta http-equiv="Expires" content="0"/>
  <meta http-equiv="Pragma" content="no-cache"/>
</head>

JSP

<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
%>

JSP static file

<script src="<%=request.getContextPath() %>/path/script.js?t=<%=(new Date()).getTime()%>"></script>

 

댓글