這裏有一個類似的問題,但答案是2歲以上,我不能得到它的工作。如果我錯過了一些東西 - 請讓我知道。
Bottle.py caching templates despite being in debug mode瓶框架甚至在調試模式下緩存我的模板
每當瀏覽器指向0.0.0.0:8080/16boxes,我需要防止緩存。 Bottle文檔說,在調試模式下,緩存被禁用,但不幸的是,這種情況並非如此。
這裏是我的問題代碼hello.py:
@route('/16boxes')
def send_static():
response.set_header('Cache-control', 'no-cache, must-revalidate')
return template (resource_path('16boxes.html'), globalVar0 = globalVar0)
run(host='0.0.0.0', port=8080, debug=True)
我打開終端,運行:python hello.py
它做,當我在我的Mac/Chrome的運行它不會緩存 - 但是當我使用Windows和Internet Explorer - 它使用緩存版本。我怎樣才能防止這一點?
在我16boxes.html,我甚至在我的下面:
<meta http-equiv="Cache-control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Pragma" content="no-cache">
當您更改文件時,您的應用程序是否會重新加載? – ahmed
不,只有當我在瀏覽器中清除我的緩存時。 –