<defaultFtpCachePolicy> Element (Network Settings)

 

Describes whether FTP caching is active and describes the default caching policy.

<configuration>
<system.net>
<requestCaching>
<defaultFtpCachePolicy>

< defaultFtpCachePolicy  
  policyLevel="BypassCache|Default|CacheOnly|CacheIfAvailable|Revalidate|Reload|NoCacheNoStore|Revalidate"  
/>  

The following sections describe attributes, child elements, and parent elements.

Attributes

AttributeDescription
policyLevelSpecifies the FTP caching policy. The default value is Default.
ValueDescription
DefaultReturns the cached resource if the resource is fresh, the content length is accurate, and the expiration, modification, and content length attributes are present.
BypassCacheReturns the resource from the server.
CacheOnlyReturns the cached resource if the content length is present and matches the entry size.
CacheIfAvailableReturns the cached resource if the content length is provided and matches the entry size; otherwise, the resource is downloaded from the server and is returned to the caller.
RevalidateReturns the cached resource if the timestamp of the cached resource is the same as the timestamp of the resource on the server; otherwise, the resource is downloaded from the server, stored in the cache, and returned to the caller.
ReloadDownloads the resource from the server, stores it in the cache, and returns the resource to the caller.
NoCacheNoStoreIf a cached resource exists, it is deleted. The resource is downloaded from the server and is returned to the caller.
RevalidateSatisfies a request by using the cached copy of the resource if the timestamp is the same as the timestamp of the resource on the server; otherwise, the resource is downloaded from the server, presented to the caller, and stored in the cache.

Child Elements

None.

Parent Elements

ElementDescription
requestCachingControls the caching mechanism for network requests.

The following code example shows how to specify an FTP caching policy of NoCacheNoStore.

<configuration>  
  <system.net>  
    <requestCaching>  
      <defaultFtpCachePolicy  
        Level="NoCacheNoStore">  
      </defaultFtpCachePolicy>  
    </requestCaching>  
  </system.net>  
</configuration>  

System.Net.Cache
WebRequest
RequestCacheLevel
Network Settings Schema

Show: