Skip to content

Instantly share code, notes, and snippets.

@mitjafelicijan
Created February 2, 2019 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitjafelicijan/9de9be557f928be80fc8c9673ec22cb8 to your computer and use it in GitHub Desktop.
Save mitjafelicijan/9de9be557f928be80fc8c9673ec22cb8 to your computer and use it in GitHub Desktop.
Python Bottlepy redirect with caching fix
# python ➜ bottlepy web micro-framework
response = bottle.HTTPResponse(status=302)
response.set_header("Cache-Control", "no-store, no-cache, must-revalidate")
response.set_header("Expires", "Thu, 01 Jan 1970 00:00:00 GMT")
response.set_header("Location", url)
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment