2
votes

I have been trying to find a way to configure the IIS 'outputcaching' setting. I have been looking around and having really had anything that works. I am basically trying to set output caching for an extension .pdf and the setting "until changed".

I've tried this code:

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST/Default Web 
Site' -Filter "system.webServer/caching/profiles/add[@extension='.pdf']" -
Name "kernelCachePolicy" -Value "CacheUntilChange"

but that gave me the following error:

WARNING: Target configuration object 'system.webServer/caching/profiles/add[@extension='.pdf'] is not found at path 'MACHINE/WEBROOT/APPHOST/Default Web Site'.

1
Try using Add-WebConfigurationProperty - ArcSet
Thank you ArcSet that I didn't get the error message but it did not add the rule for ouput caching. - NIK_77
Press the up mark on my comment please - ArcSet
I tried logging in and out but I am unable to see the up arrow on your comments. - NIK_77
Thank you Ill just Put a replay and you can mark accepted - ArcSet

1 Answers

0
votes

Try using Add-WebConfigurationProperty

Add-WebConfigurationProperty Will add a property that isn't there.

Set-WebConfigurationProperty Changes the value of a property that already exists