设置缓存控制的正确方法是什么?
有时我会看到使用标题[]
self.response.headers["Pragma"]="no-cache"
self.response.headers["Cache-Control"]="no-cache, no-store, must-revalidate, pre-check=0, post-check=0"
self.response.headers["Expires"]="Thu, 01 Dec 1994 16:00:00"
其他时候,我看到headers.add_header()
self.response.headers.add_header("Pragma","no-cache")
self.response.headers.add_header("Cache-Control","no-cache, no-store, must-revalidate, pre-check=0, post-check=0")
self.response.headers.add_header("Expires","Thu, 01 Dec 1994 16:00:00")
甚至混合了header []和headers.add_header()
self.response.headers["Pragma"]="no-cache"
self.response.headers.add_header("Cache-Control","no-cache, no-store, must-revalidate, pre-check=0, post-check=0")
self.response.headers.add_header("Expires","Thu, 01 Dec 1994 16:00:00")