Learn how to use Configuration Editor to edit collections. For this example we will be configuring Output Caching to highlight the new functionality.
This walkthrough requires the following prerequisites:
Accessing the system.webServer/caching Configuration Section
- Open IIS Manager
- Select the Server in the Connections Tree View
Open the Configuration Editor User Interface module
In the Configuration Editor Section combo box, Select system.webServer – caching or type system.webServer/caching
Use Collection Editor to Add Three Cache Rules
Select the profiles entry within Configuration Editor and click the … button next to (Count=0). This will open the Collection Editor to edit the caching collection.
In the Actions Task Pane on the right hand side, click Add. You will now have a new entry in the Items section as well as a property listing.
- The Properties section of collection editor comes pre-populated with the schema defaults for the defined collection. In this case, you get the schema defaults for system.webServer/caching collection elements.
- There is a key next to the extension property entry. This means that this is the unique key for this collection entry. Gold keys mean that this key must be unique for each item within the collection. A silver key means that this is a shared key. The combination of shared keys must be unique for a collection item in this case.
- Change the extension entry to be ".html" to create a static content caching rule.
- Change the location entry to be ServerAndClient.
- Change the policy entry to cache for CacheForTimePeriod, this will cache this static content for 30 seconds.
Add two more cache rules by clicking Add in the Actions task pane. Configure them how you like.
- Close Collection Editor.
In order to set the changes you must click Apply in the Actions Task Pane. Before you do that, click Generate Script in the Actions Task Pane. Now you have script code to set the three cache rules that were created.
- Click Apply in the Actions Task pane to make the changes to config.
- [Extra Step] If you don't want to keep any of the cache rules that you created, edit the caching collection again and click Clear All in the Actions Task Pane. Click Apply within Configuration editor and all of your rules will be removed.
You have now created three output caching rules using Configuration Editor's Collection Editor. Collection Editor exposes all of the configuration settings for a given collection, just as Configuration Editor does.