Skip to content

Instantly share code, notes, and snippets.

@tcurvelo
Created April 15, 2013 20:39
Show Gist options
  • Save tcurvelo/5391108 to your computer and use it in GitHub Desktop.
Save tcurvelo/5391108 to your computer and use it in GitHub Desktop.
Restricted Python script for streaming a file in Zope, avoiding cache.
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