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
--- 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):
--- 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