Creating Static Content Website in IIS 7
The configuration below will give you a result of 100/100 with the Google Page Speed Firefox Plugin.
You will get a Lock Violation error, this is because at the higher level of the IIS7 settings hierarchy, the modules section (and individual modules themselves) are set as locked so that you cannot override/remove them within a web.config file. This is by design, since the modules are really what make up a running IIS system.
To be able to do a clear of modules in web.config, you need to do the following:
- Make a backup copy of %windir%\System32\inetsrv\config\applicationHost.config
- Open up %windir%\System32\inetsrv\config\applicationHost.config – you will need to open your editor as an administrator. Also, if you are on 64bit Windows, you will need to use a 64bit editor in order to see the file.
- Find the configSections area – in the sectionGroup for system.WebServer – there will be a line that says:
- Change the overrideModeDefault to be Allow instead of Deny. This still won’t let you do a clear in the web.config/modules though, because many of the core modules are locked individually.
- Now look for the modules section in applicationHost.config.
- Many of the modules listed here have the lockItem attribute set to True.
- Change them all to be False.
- Save your applicationHost.config.
You should now be able to clear modules in your web.config file.
This article Deploying a Static Content Server (IIS 7) may also be useful.