View Single Post
  #4 (permalink)  
Old 07-15-2008, 01:40 PM
82rathi.angara 82rathi.angara is offline
Member
 
Join Date: Jun 2008
Posts: 55
Rep Power: 0
82rathi.angara is on a distinguished road
Default This is no-cache problem?
Originally Posted by fishtoprecords View Post
This is not a problem, its a feature.

Why do you consider it a problem, this is how the Web works.

Building applications that do what you want, and still let the user use the browser's back and forward buttons has been a challenge from the beginning. Its a feature. Its why we developers get paid big bucks.


ya ...you are saying right that this is not problem . But we need Solution when i return to shop cart page to product page and again go to shop cart page ....this warning page come........

Somebody told me that this is no-cache problem . I put some code in our java file.
Like this:
public class AntiCacheFilter implements Filter {
public void destroy() {}

public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
if (response instanceof HttpServletResponse) {
((HttpServletResponse) response).setHeader("Cache-Control",
"no-cache, must-revalidate");
((HttpServletResponse) response).setHeader("Pragma", "No-cache");
((HttpServletResponse) response).setDateHeader("Expires", 1L);
}

chain.doFilter(request, response);
}

public void init(FilterConfig config) throws ServletException {}
}




I added this code
((HttpServletResponse) response).setHeader("Pragma", "No-cache");
((HttpServletResponse) response).setDateHeader("Expires", 1L);
in file .But No solution.....
Reply With Quote