エラー ログに、次のエラーとスタック トレースが表示されます。
ページ エラー: URL: /SiteCollectionImages/Push/zh-cn/Machining_calculators.jpg
デバッグ有効: False
相関 ID: 857a397e-8063-447c-af92-b114074282b8
メッセージ: HTTP ヘッダーが送信された後、サーバーはヘッダーを追加できません。
ソース: System.Web
StackTrace
:
Microsoft.SharePoint.Publishing.BlobCache.SetResponseHeaders(HttpContext コンテキスト、BlobCacheEntry ターゲット)の System.Web.HttpResponse.AppendHeader(文字列名、文字列値)で
Microsoft.SharePoint.Publishing.BlobCache.SendCachedFile( HttpContext コンテキスト、BlobCacheEntry ターゲット、SPUserToken currentUserToken、SiteEntry currentSiteEntry)
Microsoft.SharePoint.Publishing.BlobCache.SendCachedFile (HttpContext コンテキスト、BlobCacheEntry ターゲット、SiteEntry currentSiteEntry)
で Microsoft.SharePoint.Publishing.BlobCache.HandleCachedFile (HttpContext コンテキスト、BlobCacheEntry ターゲット、ブール値の anonymousUser、SiteEntry currentSiteEntry) で Microsoft.SharePoint.Publishing. System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() での Microsoft.SharePoint.Publishing.PublishingHttpModule.AuthorizeRequestHandler (オブジェクト送信者、EventArgs ea) の BlobCache.RewriteUrl (オブジェクト送信者、EventArgs e、ブール preAuthenticate
)
System.Web.HttpApplication.ExecuteStep (IExecutionStep ステップ、ブール値 & completedSynchronously) で
組み込みの BlobCache は、応答がサーバーに送信された後に httpresponse-headers を設定しようとしているようです。これを修正する方法を知っている人はいますか、それとも SharePoint プラットフォームのバグですか?
更新: 私の web.config は次のようになります。
<BlobCache location="d:\BlobCache\companyname" path="\.(gif|jpg|jpeg|jpe|jfif|bmp|dib|tif|tiff|ico|png|wdp|hdp|css|js|asf|avi|flv|m4v|mov|mp3|mp4|mpeg|mpg|rm|rmvb|wma|wmv)$" maxSize="10" enabled="true" />
また、これはすべての画像リクエストで発生するわけではないことにも注意してください。すべての画像リクエストの約 90 ~ 95% が、指定された場所に適切にキャッシュされ、適切な応答コードでクライアントに送信されます。
Update2: HttpModules から HttpApplication へのフック:
app.PreSendRequestContent += new EventHandler(app_PreSendRequestContent);
および HttpModule のいくつかの SharePoint 固有のコード:
var spApp = context as SPHttpApplication;
if (spApp != null)
{
var labelHandler = new VaryByLabelHandler();
spApp.RegisterGetVaryByCustomStringHandler(labelHandler);
var countryHandler = new VaryByCountryHandler();
spApp.RegisterGetVaryByCustomStringHandler(countryHandler);
var claimHandler = new VaryByClaimHandler();
spApp.RegisterGetVaryByCustomStringHandler(claimHandler);
}