在整个 Azure 部署的每个实例上的整个 IIS 中的每个站点上执行内存作业
假设内存作业已设置或清理缓存,我知道 AppFabric 并且我只是使用缓存作为示例。
目前,我在 Azure 中有一个包含 4 个实例的 ASP.net MVC3 部署。 每个实例都有多个网站,由 ServiceDefinition.csdef
Sites 部分定义,其中 18 个。它在 .cspkg
包的 sitesroot
中文件夹为 1 到 17。
我想知道,是否有任何机制可以循环所有 Azure 实例,然后循环所有 IIS 站点来调用 MVC 控制器?
Lets assume Memory Job is set or clean cache, I know AppFabric and I just use cache as example.
I have a ASP.net MVC3 deployment with 4 instances in Azure at this moment.
Each instance has multiple websites, defined by ServiceDefinition.csdef
Sites section, 18 of them. It's foldered as 1 to 17 in sitesroot
in .cspkg
package.
I want to know, is there any mechanism to loop all Azure Instances, then loop all IIS sites to call a MVC Controller?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单的答案是否定的,没有内置功能可以迭代所有实例上的所有站点。
假设您想要这样做,因为您想告诉这些站点缓存中的某些数据已发生更改,最简单的解决方法是让每个站点轮询缓存更新,或者只是使数据过期一定时间后缓存。
更复杂的选项是为每个站点提供内部端点,然后当站点启动时,它会向缓存控制器服务注册该内部端点。当某些可缓存的数据更新时,缓存控制器服务会与所有向其注册的端点进行通信,以刷新其缓存。
The simple answer is no, there is no built in functionality that will iterate through all of your sites on all of your instances.
Presuming you want to do this as you want to tell these sites that there has been a change to some data that is in the cache, the simplest way around this is to have each site poll for updates to your cache, or just expire data out of the cache after a certain period of time.
The more complicated option is to give each site and internal endpoint, then when the site starts up it registers this internal end point with a cache controller service. When some data that can be cached is updated, the cache controller service communicates with all of the endpoints that are registered with it them to refresh their cache.