问题:
IE浏览器使用https协议,无法下载和播放文件。
原因:
ie浏览器在https默认的Cache-Control配置为no-cache,在https下会导致无法下载和播放的问题。
解决:
方法一:
配置过滤器在服务器端给响应添加头信息
public class CacheFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Pragma", "public");
response.setHeader("Cache-Control", "public");
chain.doFilter(req, response);
}
public void init(FilterConfig filterConfig) {
}
public void destroy() {
}
}
在web.xml中配置相应的url-pattern
方法二:
在html文件中添加标签
<meta http-equiv="Pragma" content="public">
<meta http-equiv="Cache-control" content="public">
IE浏览器使用https协议,无法下载和播放文件。
原因:
ie浏览器在https默认的Cache-Control配置为no-cache,在https下会导致无法下载和播放的问题。
解决:
方法一:
配置过滤器在服务器端给响应添加头信息
public class CacheFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
HttpServletResponse response = (HttpServletResponse) res;
response.setHeader("Pragma", "public");
response.setHeader("Cache-Control", "public");
chain.doFilter(req, response);
}
public void init(FilterConfig filterConfig) {
}
public void destroy() {
}
}
在web.xml中配置相应的url-pattern
方法二:
在html文件中添加标签
<meta http-equiv="Pragma" content="public">
<meta http-equiv="Cache-control" content="public">