Friday, August 20, 2010

IE從Google App Engine Respnse下載檔案問題 HTTP Cache-Control標頭

今天終於解決IE瀏覽器無法下載XC Google File Service檔案的問題了
原因出在Google App Engine在Response中預設會加入Cache-Control:no-cache標頭
導致IE瀏覽器下載失敗(資料其實已經下載到電腦了,只是無法跳出下載視窗)
可能是因為no-cache告知瀏覽器不要緩存該網頁資料,導致檔案下載到暫存資料夾後,被刪除

只要在回復函式中加入

del self.response.headers['Cache-Control']

即可解決

No comments:

Post a Comment