iain duncan schrieb:
> On Mon, 2006-18-12 at 21:27 -0200, Jorge Godoy wrote:
>> iain duncan <[EMAIL PROTECTED]> writes:
>>
>>> Thanks alberto, I'm not quite clear on what you are doing there. Is that
>>> a second bogus request or a hash added to my main one? Do I just make a
>>> bogus request behind the scenes before every real request and let it get
>>> ignored?
>> You have to pass the tg_random on the request.  Every request is individually
>> cached, so doing a bogus request before the real one wouldn't solve your
>> problem. 
> 
> Maybe I'm stupid today, but I don't understand how this is done from
> Alberto's example. Do I need to make a random extra paramater and add it
> to my query string? And does that need to be added to the controller
> paramater list as well then?

I've written a patch for MochiKit 1.4 that appends a timestamp to each 
JSON-request (actually any async request). Find it attached.

You then have to configure it in the browser in JS like this:


MochiKit.Async.PREVENT_CACHING_PARAM = 'tg_random'


Diez



--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---
Index: MochiKit/Async.js
===================================================================
--- MochiKit/Async.js   (revision 1225)
+++ MochiKit/Async.js   (working copy)
@@ -365,6 +365,14 @@
                 url += "?" + qs;
             }
         }
+       if(self.PREVENT_CACHING_PARAM) {
+         if(url.indexOf("?") >=0) {
+           url += "&";
+         } else {
+           url += "?";
+         }
+         url += self.PREVENT_CACHING_PARAM + "=" + new Date().getTime();
+       }
         req.open(opts.method, url, true, opts.username, opts.password);
         if (req.overrideMimeType && opts.mimeType) {
             req.overrideMimeType(opts.mimeType);

Reply via email to