Our Sharepoint – Server needs several IIS-Resets until the pages work like expected. We think the reason is the cache.
As we have no direct access to the servers we want to code a webpart zu clear the server cache by button click. How can this be achieved?
I don’t think your actual problem is caching… you might want to be a bit more specific about what makes the pages not working, so you can get the real issue solved. Otherwise, there’s no default way to do this via SharePoint, but you can initiate an “iisreset” on the webserver via code, like this:
Note that iisreset.exe is located in the windows\system32 folder. Also note that this code needs administrator privileges to work, because you are starting an application on a remote server. You can elevate the current user to administrator (temporary) using SPSecurity.RunWithElevatedPrivileges.