I have situation described bellow: In CMS was implemented two presentation server which aren't on same machine. Client want to enable IIS caching only on one machine, but changing manually web.config isn't suggested. So I am planning to make some C# code which will make changes in web.config in order to ensure proper cache settings. Is it possible or exist any other solution ( change other settings, edit other files...) for the problem?
Asked
Active
Viewed 552 times
-1
-
I think you should read what you just wrote and write it again... its hard to understand what you mean... – Peter Jul 07 '11 at 11:59
1 Answers
0
"You can configure the element at the server level in the ApplicationHost.config file or at the site, application, or at the directory level in a Web.config file."
If you have physical access to the server you can run from the console appcmd.exe:
appcmd.exe set config -section:system.webServer/caching /+"profiles.[extension='asp',policy='CacheUntilChange',kernelCachePolicy='CacheUntilChange']" /commit:apphost
Check this link: http://www.iis.net/ConfigReference/system.webServer/caching
EDITED
The first answer to this question says how to configure caching at folder level, the 2nd answer for file level:
How to configure static content cache per folder and extension in IIS7?
If you didn't specify any caching rules at file or folder level, disabling global caching should do it.

Community
- 1
- 1

Răzvan Flavius Panda
- 21,730
- 17
- 111
- 169
-
1Is it enough to disable caching only in IIS Output Cache or I must disable it in all website and folder inside IIS. – Bogdan Stojanovic Jul 07 '11 at 11:30