# HG changeset patch # User Pawel Solyga # Date 1234723813 0 # Node ID d05a9bf08c11b7f39f6ea9dc633b0784ed42f2ae # Parent 8e3bd495729ff03e6fd722329ec8f96c4126248d Hopefully fix json caching issues in IE7. Will wait for Lennie to confirm if it works correctly now. Patch by: Pawel Solyga Review by: to-be-reviewed diff -r 8e3bd495729f -r d05a9bf08c11 app/soc/views/models/base.py --- a/app/soc/views/models/base.py Sun Feb 15 16:11:47 2009 +0000 +++ b/app/soc/views/models/base.py Sun Feb 15 18:50:13 2009 +0000 @@ -35,6 +35,7 @@ from soc.views.helper import decorators from soc.views.helper import forms from soc.views.helper import redirects +from soc.views.helper import responses from soc.views import sitemap import soc.logic @@ -623,9 +624,12 @@ template = 'soc/json.html' response = responses.respond(request, template, context) - # TODO IE7 seems to ignore the headers + # if the browser supports HTTP/1.1 + # post-check and pre-check and no-store for IE7 + response['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0' + # if the browser supports HTTP/1.0 response['Pragma'] = 'no-cache' - response['Cache-Control'] = 'no-cache, must-revalidate' + return response def _editPost(self, request, entity, fields): diff -r 8e3bd495729f -r d05a9bf08c11 app/soc/views/models/org_app.py --- a/app/soc/views/models/org_app.py Sun Feb 15 16:11:47 2009 +0000 +++ b/app/soc/views/models/org_app.py Sun Feb 15 18:50:13 2009 +0000 @@ -183,7 +183,7 @@ program_entity = program_logic.logic.getFromKeyName(kwargs['scope_path']) - # get all pre-accepted org applications for the given program + # get all pre-accepted organization applications for the given program filter = {'scope' : program_entity, 'status' : 'pre-accepted'} org_app_entities = org_app_logic.logic.getForFields(filter=filter) @@ -209,9 +209,13 @@ template = 'soc/json.html' response = responses.respond(request, template, context) - # TODO IE7 seems to ignore the headers + + # if the browser supports HTTP/1.1 + # post-check and pre-check and no-store for IE7 + response['Cache-Control'] = 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0' + # if the browser supports HTTP/1.0 response['Pragma'] = 'no-cache' - response['Cache-Control'] = 'no-cache, must-revalidate' + return response