우리는 2 개 개의 다른 관리 경로 아래 사이트 모음을 가지고 있습니다 SharePoint 웹 응용 프로그램 (depts & 사무실) 등이셰어는 현재 사용자의 사이트 모음을 가져
http://sharepoint.abc/depts/finance
http://sharepoint.abc/depts/isg
http://sharepoint.abc/offices/boston
http://sharepoint.abc/offices/chicago
사용자가 로그인하면 해당 사용자에게 읽기 권한이있는 사이트 모음 목록이 는 WebPart
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite spSite = new SPSite(SPContext.Current.Site.Url))
{
foreach (SPSite site in spSite.WebApplication.Sites)
{
try
{
var rootWeb = site.RootWeb;
if (rootWeb.DoesUserHavePermissions(SPContext.Current.Web.CurrentUser.LoginName, SPBasePermissions.ViewPages))
{
if (this.ValidSite(rootWeb.Url))
{
string url = GetRelativePath(rootWeb.Url);
allowedSites.Add(new SiteInfo(rootWeb.Title, url));
}
}
}
catch (Exception ex)
{
this.Controls.Add(new LiteralControl("<br/>GetAllowedSites Error: " + ex.Message));
}
}
}
});
그것은 잘 작동하지만, 생산에가는 WebPart를 (우리가이 개 경로에 걸쳐 700 개 사이트 모음이)로드 20 초 정도에 다음 C# 코드.
캐싱을 사용하여 사이트 목록을 보관했지만 캐시가 만료되면 재생성에 20 초가 걸립니다.
내가 원하는 것은 사용자가 모든 사이트 모음을 반복하지 않고 사용자가 액세스 할 수있는 사이트 모음을 확인하는 것입니다. 이게 성취 될 수 있니?
감사
eaigs
부하 분산 팜도 있으므로 사용자가 다른 서버에 놓이게 될 때마다 캐시 자체를 다시 만들어야합니다. – ASG