简体   繁体   中英

Restart remote IIS site in another site

I have more than one site on iis. Some sites working on another machine also but they are using same database.

Sites have caching mechanism. One of the site using for making customization about sites. Customization are saved on DB. I want to reset caching for sites which are effected from customization. I can found two thecnique for this.

I want to asking for another solution.

Technic 1: adding restart endpoint for sites in web.config file and calling them when change made by user.

Technic 2: using db events for catching changes (in asp.net application may be I can't get changes because of sites dying after idle time)

Both of the techniques listed in your question have drawbacks. Technique 1 restarts the entire server, which is over-kill. Technique2 has the drawback you list, and is relatively complex to implement.

The approach I use is to provide a controller action that invalidates caches. That action requires authentication, and can be accessed either via an administrative web page on the server (single instance server), or can be invoked by accessing the URL of the controller action and providing appropriate credentials (server farm, invoke eg https://ServerNameOrIp/Admin/InvalidateCache once for each server/IP in the farm).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM