0
如何緩存僅圖像而不是Javascript和Css文件?Asp.Net緩存但不支持javascript的圖像
是否有任何類型的頭控制哪些mimetype要緩存?
添加一些進一步的解釋:我的global.asax.cs中有以下代碼片段,這樣在我的開發環境中,我不會緩存JavaScript文件(或者需要我每次重新啓動服務器一個簡單的改變)。由於圖像很少變化,我不知道有沒有辦法。
if (ApplicationConfiguration.IsLocal()) {
//do not cache content locally, to make development faster
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
Response.Cache.SetNoStore();
}
感謝