Diez B. Roggisch wrote:
> While my own experiences with IE are rather limited, I presume that e.g. dojo
> which also adds a cachePrevention parameter does so for a good reason.
My guess is that is just for developers who can't set the proper
response headers (maybe when pulling data from servers they don't have
control over?).
> And the advantage is clearly that you can accidentally forget that header
> tinkering (which might get complicated in presence of apache & possibly squid
> in front of your cherrypy-instance), and it still works.
I suppose there could potentially be issues with other proxies between
TG<-->User Agent.
Forgetting about adding the response header entries seems about as
likely as forgetting to add the tg_random parameter to the request. We
can easily do something about the response forgetfulness:
class ExpireJSONFilter(object):
rh = cherrypy.response.headers
ct = rh.get('Content-type', None)
# not sure what exact content-type TG sets for JSON
# don't stomp on an already-set 'Expires' header
if ct == 'application/json' and 'Expires' not in rh:
rh['Expires'] = '0'
All that is left to do is plugging the filter in the appropriate place
in the application's object tree.
Christian
http://www.dowski.com
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---