Hi

I've met that problem before,because IE will cache data when the url and
parameters are the same  as previous.

You can append a random number or timestamp to each request parameter, for
example:
first request

      /foo?param1=xxx&_t=12020020302

second request

      /foo?param1=xxx&_t=12020032312


On Fri, Sep 18, 2009 at 11:33 AM, Malcolm MacKinnon <[email protected]>wrote:

> If your using jquery and a jquery ajax request, this worked for me:
> <script type="text/javascript">
> $(document).ready(function(){
> $.ajaxSetup({ cache: false });
> });
> </script>
>
> On Thu, Sep 17, 2009 at 4:56 PM, Adam V. <[email protected]> wrote:
>
>>
>> This is via an AJAX request, I assume?
>> For IE, you'll want to throw a bogus querystring on the end of the
>> URL, to make it different, so that IE won't cache it:
>>
>> client side Javascript:
>> url = whatever the url is normally.
>> var sep = (-1 < url.indexOf("?")) ? "&" : "?"
>> url = url + sep + "__=" + encodeURIComponent((new Date()).getTime());
>>
>> On Sep 17, 4:35 pm, mediumgrade <[email protected]> wrote:
>> > I have several views which generate some JSON data. They all end
>> > something like this:
>> >
>> > response = HttpResponse(pie_data, mimetype='application/json')
>> > response['Content-Disposition'] = 'attachment;
>> > filename=my_pie_chart.json'
>> >
>> > Where "pie_data" is holding some generated JSON data that I wish to
>> > send back to my application. However, Internet Explorer keeps caching
>> > this data which is messing up the JavaScript components that are
>> > actually using it. Is there something I can inject in the HTTP header
>> > to prevent IE from caching the data? Neither Firefox nor Chrome seems
>> > to exhibit this behavior.
>> >
>> > Any help would be appreciated. Thank you so much.
>>
>>
>
> >
>


-- 
黄钟鸣

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

Reply via email to