Prevent browser from caching data every time an http request is made. Returns: headers
()
| 50 | |
| 51 | |
| 52 | def get_no_cache_header(): |
| 53 | """ |
| 54 | Prevent browser from caching data every time an |
| 55 | http request is made. |
| 56 | Returns: headers |
| 57 | """ |
| 58 | headers = {} |
| 59 | # HTTP 1.1. |
| 60 | headers["Cache-Control"] = "no-cache, no-store, must-revalidate" |
| 61 | headers["Pragma"] = "no-cache" # HTTP 1.0. |
| 62 | headers["Expires"] = "0" # Proxies. |
| 63 | return headers |
| 64 | |
| 65 | |
| 66 | def make_json_response( |
no outgoing calls
no test coverage detected