Hi , 

I am facing following Issue. 

I have devloped one GWT page .It takes long time to load and display the 
contents of page. 
Sometime I need to refresh the page for proper loading of the page. 

I Have also used the cache control filter as follows. 
  Note: Text content in the code blocks is automatically word-wrapped

   1. public void doFilter (ServletRequest request, ServletResponse response, 
FilterChain filterChain) 
      
   2.             throws IOException, ServletException    
   3.     {    
   4.         HttpServletRequest httpRequest = (HttpServletRequest) request; 
      
   5.         String requestURI = httpRequest.getRequestURI ();    
   6.    
   7.         if (requestURI.contains (".nocache."))    
   8.         {    
   9.             Date now = new Date ();    
   10.             HttpServletResponse httpResponse = (HttpServletResponse) 
response; 
      
   11.             httpResponse.setDateHeader ("Date", now.getTime ());    
   12.             // one day old    
   13.             httpResponse.setDateHeader ("Expires", now.getTime () - 
86400000L); 
      
   14.             httpResponse.setHeader ("Pragma", "no-cache");    
   15.             httpResponse.setHeader ("Cache-control", 
   "no-cache, no-store, must-revalidate");    
   16.         }    
   17.    
   18.         filterChain.doFilter (request, response);    
   19.     }  

public void doFilter (ServletRequest request, ServletResponse response, 
FilterChain filterChain) throws IOException, ServletException { 
HttpServletRequest httpRequest = (HttpServletRequest) request; String 
requestURI = httpRequest.getRequestURI (); if (requestURI.contains 
(".nocache.")) { Date now = new Date (); HttpServletResponse httpResponse = 
(HttpServletResponse) response; httpResponse.setDateHeader ("Date", 
now.getTime ()); // one day old httpResponse.setDateHeader ("Expires", 
now.getTime () - 86400000L); httpResponse.setHeader ("Pragma", "no-cache"); 
httpResponse.setHeader ("Cache-control", "no-cache, no-store, 
must-revalidate"); } filterChain.doFilter (request, response); } 

and 
  Note: Text content in the code blocks is automatically word-wrapped

   1.   <filter>    
   2.         <filter-name>gwtCacheControlFilter</filter-name>    
   3.         <filter-class>com.test.GwtCacheControlFilter</filter-class>    
   4.     </filter>    
   5.         
   6.     <filter-mapping>    
   7.         <filter-name>gwtCacheControlFilter</filter-name>    
   8.         <url-pattern>/*</url-pattern>    
   9.     </filter-mapping>  

<filter> <filter-name>gwtCacheControlFilter</filter-name> 
<filter-class>com.test.GwtCacheControlFilter</filter-class> </filter> 
<filter-mapping> <filter-name>gwtCacheControlFilter</filter-name> 
<url-pattern>/*</url-pattern> </filter-mapping> 

Please let me know If something is missing.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to