Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internet explorer 9 support for the API #119

Open
rammie opened this issue Jan 10, 2014 · 0 comments
Open

Internet explorer 9 support for the API #119

rammie opened this issue Jan 10, 2014 · 0 comments

Comments

@rammie
Copy link

rammie commented Jan 10, 2014

I recently ran into this in production. If you like the fix, I can put together a pull request, though it's just a couple of lines. I had to add cache control headers to the response to prevent the great IE9 from caching ajax requests.

class RestResource(RestResource):
...
def response(self, data):
kwargs = {} if request.is_xhr else {"indent": 2}
resp = Response(json.dumps(data, **kwargs), mimetype="application/json")
resp.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
resp.headers["Pragma"] = "no-cache"
resp.headers["Expires"] = 0
return resp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant