Skip to content

Commit

Permalink
Merge pull request #3484 from nyu-ossd-s18/ash.disable-cache-and-etags
Browse files Browse the repository at this point in the history
Disable cache when downloading file
  • Loading branch information
takluyver authored Apr 11, 2018
2 parents ca3e7a3 + e56060a commit f69ce9f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions notebook/nbconvert/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def respond_zip(handler, name, output, resources):
zip_filename = os.path.splitext(name)[0] + '.zip'
handler.set_attachment_header(zip_filename)
handler.set_header('Content-Type', 'application/zip')
handler.set_header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')

# Prepare the zip file
buffer = io.BytesIO()
Expand Down Expand Up @@ -138,6 +139,7 @@ def get(self, format, path):
self.set_header('Content-Type',
'%s; charset=utf-8' % exporter.output_mimetype)

self.set_header('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0')
self.finish(output)

class NbconvertPostHandler(IPythonHandler):
Expand Down

0 comments on commit f69ce9f

Please sign in to comment.