HttpCachePolicy.SetNoTransforms 方法

定義

設定 Cache-Control: no-transform HTTP 標頭。Sets the Cache-Control: no-transform HTTP header.

public:
 void SetNoTransforms();
public void SetNoTransforms ();
member this.SetNoTransforms : unit -> unit
Public Sub SetNoTransforms ()

範例

下列程式碼範例示範如何傳送目前回應的指示詞 Cache-Control: no-transformThe following code example demonstrates how to send the Cache-Control: no-transform directive with the current response.

Response.Cache.SetNoTransforms();

Response.Cache.SetNoTransforms()
    

備註

Cache-Control: no-transformHTTP 標頭會指示網路快取應用程式不修改檔。The Cache-Control: no-transform HTTP header instructs network caching applications not to modify the document.

Cache-Control: no-transformHTTP 標頭會防止下游 proxy 伺服器變更、或標頭所指定的任何標頭值 Content-Encoding Content-Range Content-Type (這包括實體主體) 。The Cache-Control: no-transform HTTP header prevents downstream proxy servers from changing any header values specified by the Content-Encoding, Content-Range, or Content-Type headers (this includes the entity body). 例如,它會防止 proxy 將 GIF 影像轉換為 PNG。For example, it prevents proxies from converting GIF images to PNG.

如同快取的其他限制,呼叫一次之後 SetNoTransforms ,就 Cache-Control: no-transform 無法透過介面停用 HTTP 標頭 HttpCachePolicyAs with other restrictions on caching, once SetNoTransforms is called, the Cache-Control: no-transform HTTP header cannot be disabled through the HttpCachePolicy interface.

SetNoTransforms 在 .NET Framework 版本3.5 中引進。SetNoTransforms is introduced in the .NET Framework version 3.5. 如需詳細資訊,請參閱版本和相依性For more information, see Versions and Dependencies.

適用於