FireFox caching problems during on channel subscription

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

FireFox caching problems during on channel subscription

Robert Krombholz
Hi everyone,

I am using the grails & jQuery plugin.
Somwhow - on every second page refresh - FireFox is not able to read the
response of my AtmosphereHandler (which is fired by
AtmosphereResource#suspend()) and by that it will not really be suspended.
Here is how I subscribe on the client side (note that streaming will be
used as I am running on Tomcat):

var subscribeChannel = function(channelString, callback) {
     //Closing all active requests if there are any
     $.atmosphere.close();
     $.atmosphere.subscribe(channelString,
         callback,
         $.atmosphere.request={transport:'websocket',
fallbackTransport:'streaming', dataType:'json'}
     );
}

And here is my server-side code from the onRequest method / closure:
         ... < some application specific stuff here> ...
          //Setting content type
          event.response.setContentType('text/html;charset=UTF-8')
          //Setting proper cache headers
          event.response.addHeader("Cache-Control", "no-store")
          event.response.addHeader("Cache-Control", "no-cache")
          event.response.addHeader("Cache-Control", "must-revalidate");
          event.response.addHeader("Pragma", "no-cache");
          //For FireFox (see
http://www-archive.mozilla.org/projects/netlib/http/http-caching-faq.html)
          event.response.addHeader("Expires", "0")
          //Suspending the request - waiting for events
          event.suspend()

As you can see I've already experiented a bit with manually setting
cache headers (just noticed that the suspend methis will anyway
overwrite them).

Does anyone else already experienced this problem?
Is there maybe any kind of Filter that I should apply to my broadcaster
configuration (currently using no filter).

Cheers
Robert


Loading...