简体   繁体   中英

Cache Control not Working in Firefox

I want to set expire header for each resource files. I'm tried with resource mapping cache period.

<resources mapping="/resources/**" location="/WEB-INF/resources/" cache-period="86400"/>

Its working in chrome and safari. But not working in Firefox

Also i'm tried with another way through Filters. As same problem - not working in Firefox.

    HttpServletResponse httpResponse = (HttpServletResponse) response;
    httpResponse.setHeader("Cache-Control", "no-cache, no-store, must-revalidate"); 
    httpResponse.setHeader("Pragma", "no-cache"); 
    httpResponse.setDateHeader("Expires", System.currentTimeMillis() + 604800000L);         
    chain.doFilter(request, response

Can anyone help me!

I have a similar problem with Lotus Notes and a web form. Firefox just doesn't follow the same rules as everyone else with cache-control.

My solution was to use javascript on the front end to emulate what I was trying to accomplish with cache-control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM