All,
I've had success preventing caching in IE and FF by setting these response
headers server-side:
Cache-Control: no-cache, must-revalidate
Expires: Mon, 25 Jul 2005 05:00:00 GMT
Pragma: no-cache

I know this is a javascript-related list, but I prefer to keep as much of
this logic on the server as possible, and this seems to work well.  I'm sure
you can pick any time in the past for the Expires header.

Bob,
Is what you suggested here the "official" way to POST an xhr with mochikit?
That question comes up all the time on the list and in the irc channel; it
would be nice to be able to point people to a definitive answer (if one
exists...).

Thanks,
David Shoemaker

On 11/30/06, Bob Ippolito <[EMAIL PROTECTED]> wrote:
>
>
> That's a really bad idea in general. If you want to post, use
> something like this::
>
>     var d = doXHR(url, {
>         method: 'POST',
>         'mimeType': 'text/plain',
>         'headers': [['Accept', 'application/json']]
>     }).addCallback(MochiKit.Async.evalJSONRequest);
>
> -bob
>
> On 11/30/06, Martyn Smith <[EMAIL PROTECTED]> wrote:
> > Just as a side note, I found that by POSTING all my data rather than
> using
> > GET (which is the loadJSONDoc default) that browsers (namely IE) stopped
> > caching when it shouldn't.
> >
> > Perhaps loadJSONDoc could post by default rather than GET?, or perhaps
> have
> > an option/another function for doing this?
> >
> >
> > On 12/1/06, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> > >
> > > "Bob Ippolito" <[EMAIL PROTECTED]> writes:
> > >
> > > > Even if it was relevant, the chances of doing a request precisely
> one
> > > > hour after a previous request during the one hour per year in which
> > > > that happens is a whole lot less than getting the same random number
> > > > twice during any session at any time of the year. Especially
> > > > considering the fact that most normal people are sleeping during (at
> > > > least) the second 2am...
> > >
> > > Time changes earlier here in .br, for example.  Anyway, point taken
> and it
> > is
> > > better using the timestamp then.
> > >
> > > --
> > > Jorge Godoy      < [EMAIL PROTECTED]>
> > >
> > >
> > >
> >
> >
> >
> > --
> > Martyn
> >
> >  >
> >
>
> >
>


-- 
--- I'd give my right arm to be ambidextrous. ---


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"MochiKit" 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/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to