Created
April 15, 2013 20:39
-
-
Save tcurvelo/5391108 to your computer and use it in GitHub Desktop.
Restricted Python script for streaming a file in Zope, avoiding cache.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
request = container.REQUEST | |
response = request.RESPONSE | |
my_file = context.my_content | |
response.setHeader('Pragma', 'no-cache') | |
response.setHeader('Cache-Control', 'max-age=-1,s-maxage=-1, no-cache') | |
response.setHeader('Content-Type', my_file.content_type) | |
return my_file.data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment