Classe CachingSection
Configura l'output e la memorizzazione nella cache del kernel.
Sintassi
class CachingSection : ConfigurationSectionWithCollection
Metodi
Nella tabella seguente sono elencati i metodi esposti dalla CachingSection
classe .
Nome | Descrizione |
---|---|
Aggiungere | Ereditato da ConfigurationSectionWithCollection. |
Cancella | Ereditato da ConfigurationSectionWithCollection . |
Recupero | Ereditato da ConfigurationSectionWithCollection . |
GetAllowDefinition | Ereditato da ConfigurationSection. |
GetAllowLocation | Ereditato da ConfigurationSection . |
Rimuovi | Ereditato da ConfigurationSectionWithCollection . |
RevertToParent | Ereditato da ConfigurationSection . |
SetAllowDefinition | Ereditato da ConfigurationSection . |
SetAllowLocation | Ereditato da ConfigurationSection . |
Proprietà
Nella tabella seguente sono elencate le proprietà esposte dalla CachingSection
classe .
Nome | Descrizione |
---|---|
Enabled |
Valore di lettura/scrittura boolean . true se la cache di output è attivata. In caso contrario, false . Se la cache di output è disabilitata, non verrà eseguita alcuna memorizzazione nella cache dell'output della risposta o nella memorizzazione nella cache del kernel. Il valore predefinito è true . |
EnableKernelCache |
Valore di lettura/scrittura boolean . true se la memorizzazione nella cache del kernel è attivata; in caso contrario false . Il valore predefinito è true . |
Location |
Ereditato da ConfigurationSection .) Proprietà chiave. |
MaxCacheSize |
Valore di lettura/scrittura uint32 che specifica le dimensioni massime, in megabyte, della cache di output. Il valore predefinito è 0. Un valore pari a 0 indica che le dimensioni della memoria della cache vengono gestite automaticamente. Una dimensione di MaxValue significa che non esiste alcun limite per le dimensioni della cache. Nota: Questa impostazione è efficace solo a livello del file di ApplicationHost.config. Se si imposta questa proprietà a un livello inferiore, non avrà alcun effetto. |
MaxResponseSize |
Valore di lettura/scrittura uint32 che specifica le dimensioni massime, in byte, di una risposta che può essere archiviata nella cache di output. Il valore predefinito è 262144 (256 KB). Un'impostazione pari a 0 significa che non esiste alcun limite. Nota: Questa impostazione è efficace solo a livello del file di ApplicationHost.config. Se si imposta questa proprietà a un livello inferiore, non avrà alcun effetto. |
Path |
Ereditato da ConfigurationSection .) Proprietà chiave. |
Profiles |
Valore CachingProfileSettings che configura la memorizzazione nella cache per estensioni di richiesta specifiche. |
SectionInformation |
Ereditato da ConfigurationSection . |
Sottoclassi
Questa classe non contiene sottoclassi.
Esempio
Nell'esempio seguente vengono visualizzate proprietà nell'oggetto per il CachingSection
sito Web predefinito, inclusi i CachingProfileSettings
valori nella Profiles
proprietà array. Vengono fornite due funzioni helper per visualizzare il testo per le Policy
enumerazioni , KernelCachePolicy
e Location
.
' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")
' Get the CachingSection for the default Web site.
Set oSite = oWebAdmin.Get("Site.Name='Default Web Site'")
oSite.GetSection "CachingSection", oSection
' Display the path and location.
Wscript.Echo "Path: " & oSection.Path
Wscript.Echo "Location: " & oSection.Location
Wscript.Echo
' Display other non-array CachingSection properties.
WScript.Echo "Enabled: " & oSection.Enabled
Wscript.Echo "EnableKernelCache: " & oSection.EnableKernelCache
Wscript.Echo "MaxCacheSize: " & oSection.MaxCacheSize
Wscript.Echo "MaxResponseSize: " & oSection.MaxResponseSize
Wscript.Echo
' Display the caching profiles from the Profiles property.
For Each oCachingProfileElement In oSection.Profiles.Profiles
Wscript.Echo
WScript.Echo "[ " & oCachingProfileElement.Extension & _
" ] Caching Profile"
WScript.Echo "-----------------------------------"
WScript.Echo "Duration: " & oCachingProfileElement.Duration
WScript.Echo "KernelCachePolicy: " & _
CachePolicyText(oCachingProfileElement.KernelCachePolicy)
WScript.Echo "Location: " & _
LocationText(oCachingProfileElement.Location)
WScript.Echo "Policy: " & _
CachePolicyText(oCachingProfileElement.Policy)
WScript.Echo "VaryByHeaders: " & _
oCachingProfileElement.VaryByHeaders
WScript.Echo "VaryByQueryString: " & _
oCachingProfileElement.VaryByQueryString
WScript.Echo
Next
' Provide text for KernelCachePolicy and Policy enumeration values.
Function CachePolicyText(enumval)
Select Case enumval
Case 0
CachePolicyText="DontCache"
Case 1
CachePolicyText="CacheUntilChange"
Case 2
CachePolicyText="CacheForTimePeriod"
Case Else
CachePolicyText="Undefined enumeration value"
End Select
End Function
' Provide text for Location enumeration values.
Function LocationText(enumval)
Select Case enumval
Case 0
LocationText="Any"
Case 1
LocationText="Client"
Case 2
GetLocationText="Downstream"
Case 3
LocationText="Server"
Case 4
LocationText="None"
Case 5
LocationText="ServerAndClient"
Case Else
LocationText="Undefined enumeration value"
End Select
End Function
Gerarchia di ereditarietà
ConfigurationSectionWithCollection
CachingSection
Requisiti
Tipo | Descrizione |
---|---|
Client | - IIS 7.0 in Windows Vista - IIS 7.5 in Windows 7 - IIS 8.0 in Windows 8 - IIS 10.0 in Windows 10 |
Server | - IIS 7.0 in Windows Server 2008 - IIS 7.5 in Windows Server 2008 R2 - IIS 8.0 in Windows Server 2012 - IIS 8.5 in Windows Server 2012 R2 - IIS 10.0 in Windows Server 2016 |
Prodotto | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
File MOF | WebAdministration.mof |
Vedere anche
Classe AspCache
Classe CachingProfileElement
Classe CachingProfileSettings
Classe ConfigurationSection
Classe ConfigurationSectionWithCollection
Classe HttpClientCache