0

我有一个奇怪的问题,当我在 Orchard CMS 中启用输出缓存并启用 ImageResizer.net 缓存插件时,我得到了重复的页面内容(完整的 DOM)。仅供参考,我正在部署到 Azure 小型预留实例。

任何想法如何解决这个问题 - 我是否需要为输出缓存创建缓存配置文件而不是缓存图像,因为这是由缓存插件处理的?

提前致谢,

彼得

诊断信息:

Image resizer diagnostic sheet      2/13/2013 9:07:32 PM

1 Issues detected:

(Warning):  To potentially see additional errors here, perform an image resize request.



You are using paid bundles: Performance Bundle

Registered plugins:

ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.MvcRoutingShim.MvcRoutingShimPlugin
ImageResizer.Plugins.DiskCache.DiskCache

Configuration:

<resizer>
<diagnostics enableFor="allhosts" />
<pipeline fakeExtensions=".ashx" />
<plugins>
<add name="MvcRoutingShim" />
<add name="DiskCache" />
</plugins>
</resizer>


Accepted querystring keys:

quality, format, thumbnail, maxwidth, maxheight, width, height, w, h, scale, stretch, crop, cropxunits, cropyunits, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, ignoreicc, frame, useresizingpipeline, cache, process, margin, anchor, dpi, mode, zoom, 

Accepted file extensions:

bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi, 

Environment information:

Running Microsoft-IIS/7.5 on Microsoft Windows NT 6.1.7601 Service Pack 1 and CLR 4.0.30319.17929
Trust level: Unrestricted
OS bitness: x86 !! Warning, running as 32-bit on a 64-bit OS(AMD64). This will limit ram usage !!
Executing assembly: D:\Windows\SysWOW64\inetsrv\w3wp.exe
IntegratedPipeline: True

Loaded assemblies:

mscorlib                                 Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Web                               Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System                                   Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Core                              Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Configuration                     Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Xml                               Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Runtime.Caching                   Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Microsoft.Build.Utilities.v4.0           Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Web.RegularExpressions            Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Microsoft.JScript                        Assembly: 10.0.0.0        File: 11.0.50709.17929 Info: 11.0.50709.17929
System.Web.WebPages.Deployment           Assembly: 2.0.0.0         File: 2.0.20710.0    
System.Web.Http.WebHost                  Assembly: 4.0.0.0         File: 4.0.20710.0    
EnvSettings                              Assembly: 1.0.0.0         File: 7.1.1976.0     
System.Web.WebPages                      Assembly: 2.0.0.0         File: 2.0.20710.0    
System.Web.WebPages.Razor                Assembly: 2.0.0.0         File: 2.0.20710.0    
System.Web.Mvc                           Assembly: 4.0.0.0         File: 4.0.20710.0    
Microsoft.Web.Infrastructure             Assembly: 1.0.0.0         File: 1.0.20105.407  
App_global.asax                          Assembly: 0.0.0.0        
Orchard.Web                              Assembly: 1.6.0.0         File: 1.6            
Orchard.Framework                        Assembly: 1.6.0.0         File: 1.6            
Autofac                                  Assembly: 2.6.3.862       File: 2.6.3.862      
System.ServiceModel.Activation           Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.ServiceModel.Internals            Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.ServiceModel                      Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
SMDiagnostics                            Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Xaml.Hosting                      Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Web.Extensions                    Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Orchard.WarmupStarter                    Assembly: 1.6.0.0         File: 1.6            
Microsoft.CSharp                         Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Xml.Linq                          Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.ComponentModel.DataAnnotations    Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Web.DynamicData                   Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Autofac.Configuration                    Assembly: 2.6.3.862       File: 2.6.3.862      
Castle.Core                              Assembly: 1.1.0.0         File: 1.1.0.0         Info: 1.1.0.0
Castle.DynamicProxy2                     Assembly: 2.1.0.0         File: 2.1.0.0         Info: 2.1.0.0
ClaySharp                                Assembly: 1.0.0.0         File: 1.0.0.0        
FluentNHibernate                         Assembly: 1.3.0.733      
Iesi.Collections                         Assembly: 1.0.1.0         File: 3.3.1.4000      Info: 1.0
ImageResizer                             Assembly: 3.2.4.698       File: 3.2.4.698       Info: 3-2-4  Commit: 4b94e40
ImageResizer.Mvc                         Assembly: 3.2.4.698       File: 3.2.4.698       Info: 3-2-4  Commit: 4b94e40
ImageResizer.Plugins.DiskCache           Assembly: 3.2.4.698       File: 3.2.4.698       Info: 3-2-4  Commit: 4b94e40
log4net                                  Assembly: 1.2.11.0        File: 1.2.11.0        Info: 1.2
MySql.Data                               Assembly: 6.5.4.0        
Newtonsoft.Json                          Assembly: 4.5.0.0         File: 4.5.8.15203    
NHibernate                               Assembly: 3.3.1.4000      File: 3.3.1.4000      Info: 3.3.1.4000
NHibernate.Linq                          Assembly: 0.0.0.0        
NuGet.Core                               Assembly: 1.1.0.0        
Orchard.Core                             Assembly: 1.6.0.0         File: 1.6            
System.Data.SqlServerCe                  Assembly: 4.0.0.0         File: 4.0.8482.1      Info: 4.0
System.Net.Http                          Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Net.Http.Formatting               Assembly: 4.0.0.0         File: 4.0.20710.0    
System.Web.Helpers                       Assembly: 2.0.0.0         File: 2.0.20710.0    
System.Web.Http                          Assembly: 4.0.0.0         File: 4.0.20710.0    
System.Web.Razor                         Assembly: 2.0.0.0         File: 2.0.20710.0    
System.Web.Abstractions                  Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Web.Routing                       Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Data.Linq                         Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Drawing                           Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.ComponentModel.Composition        Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Anonymously Hosted DynamicMethods Assembly Assembly: 0.0.0.0        
System.Runtime.Serialization             Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
DynamicProxyGenAssembly2                 Assembly: 0.0.0.0        
Contrib.ProjectionLayouts                Assembly: 0.0.0.0        
Orchard.Forms                            Assembly: 1.6.0.0         File: 1.6            
Orchard.Projections                      Assembly: 1.6.0.0         File: 1.6            
Orchard.Alias                            Assembly: 1.6.0.0         File: 1.6            
Orchard.Tokens                           Assembly: 1.6.0.0         File: 1.6            
Orchard.Autoroute                        Assembly: 1.6.0.0         File: 1.6            
Orchard.jQuery                           Assembly: 1.6.0.0         File: 1.6            
Orchard.PublishLater                     Assembly: 1.6.0.0         File: 1.6            
Orchard.Scripting                        Assembly: 1.6.0.0         File: 1.6            
Orchard.Themes                           Assembly: 1.6.0.0         File: 1.6            
Orchard.Widgets                          Assembly: 1.6.0.0         File: 1.6            
Orchard.ContentPicker                    Assembly: 0.0.0.0        
Orchard.Blogs                            Assembly: 1.6.0.0         File: 1.6            
Orchard.Comments                         Assembly: 1.6.0.0         File: 1.6            
Orchard.Disqus                           Assembly: 0.0.0.0        
Orchard.Rules                            Assembly: 1.6.0.0         File: 1.6            
Orchard.Media                            Assembly: 1.6.0.0         File: 1.6            
Orchard.MediaPicker                      Assembly: 1.6.0.0         File: 1.6            
Szmyd.Orchard.Modules.Sharing            Assembly: 0.0.0.0               
Lucene                                   Assembly: 1.6.0.0         File: 1.6            
Orchard.Users                            Assembly: 1.6.0.0         File: 1.6            
System.Web.ApplicationServices           Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Orchard.Roles                            Assembly: 1.6.0.0         File: 1.6            
Orchard.ContentTypes                     Assembly: 1.6.0.0         File: 1.6            
Orchard.DesignerTools                    Assembly: 1.6.0.0         File: 1.6            
Orchard.Fields                           Assembly: 0.0.0.0        
Orchard.Indexing                         Assembly: 1.4.1.0         File: 1.4.1          
Orchard.Modules                          Assembly: 1.6.0.0         File: 1.6            
Orchard.Packaging                        Assembly: 1.6.0.0         File: 1.6            
System.Data.Services.Client              Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Orchard.Pages                            Assembly: 1.6.0.0         File: 1.6            
Orchard.Recipes                          Assembly: 1.6.0.0         File: 1.6            
Orchard.Search                           Assembly: 1.6.0.0         File: 1.6            
Orchard.Tags                             Assembly: 1.6.0.0         File: 1.6            
Orchard.Warmup                           Assembly: 1.6.0.0         File: 1.6            
SysCache                                 Assembly: 0.0.0.0        
TinyMce                                  Assembly: 1.6.0.0         File: 1.6            
Vandelay.Industries                      Assembly: 0.0.0.0        
MovieRentalOffers                        Assembly: 1.0.0.0         File: 1.0.0.0        
System.Data                              Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Transactions                      Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.EnterpriseServices                Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Numerics                          Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
Microsoft.GeneratedCode                  Assembly: 1.0.0.0        
NHibernate.Caches.SysCache2              Assembly: 3.1.0.4000      File: 3.1.0.4000      Info: 3.1.0.4000
ActionRecordProxyAssembly                Assembly: 0.0.0.0        
ContentPartDefinitionRecordProxyAssembly Assembly: 0.0.0.0        
Lucene.Net                               Assembly: 2.9.4.1         Info: 2.9.4
System.Web.Mobile                        Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
System.Xaml                              Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
PermissionRecordProxyAssembly            Assembly: 0.0.0.0        
System.Dynamic                           Assembly: 4.0.0.0         File: 4.0.30319.17929 Info: 4.0.30319.17929
ContentFieldDefinitionRecordProxyAssembly Assembly: 0.0.0.0        
DynamicProxyGenAssembly2                 Assembly: 0.0.0.0        
DynamicProxyGenAssembly2                 Assembly: 0.0.0.0        
ContentItemRecordProxyAssembly           Assembly: 0.0.0.0        
App_Web_bjaujelw                         Assembly: 0.0.0.0        
App_Web_3ucixrnn                         Assembly: 0.0.0.0        
DynamicProxyGenAssembly2                 Assembly: 0.0.0.0        
App_Web_hqpkyqpq                         Assembly: 0.0.0.0        
App_Web_4rtpbaer                         Assembly: 0.0.0.0        
App_Web_hn4szlb4                         Assembly: 0.0.0.0        
ContentTypeRecordProxyAssembly           Assembly: 0.0.0.0        
App_Web_fmcezex3                         Assembly: 0.0.0.0        
App_Web_0wv5slaj                         Assembly: 0.0.0.0        
App_Web_z1olvxy5                         Assembly: 0.0.0.0        
ProviderPartRecordProxyAssembly          Assembly: 0.0.0.0        
App_Web_j0ak4epp                         Assembly: 0.0.0.0        
4

2 回答 2

0

Orchard 1.7 and new OutputCache module solves this problem. You can view it here: https://orchardcache.codeplex.com/workitem/26

于 2013-08-05T15:21:31.790 回答
0

这可以在没有 ImageResizer 的情况下复制,使用以下 HttpModule:

public class BlankModule : IHttpModule {

    void IHttpModule.Init(System.Web.HttpApplication context) {
        //Having any event handlers registered for this event causes cache duplication during the Filter execution
        context.PreSendRequestHeaders -= context_PreSendRequestHeaders;
        context.PreSendRequestHeaders += context_PreSendRequestHeaders;
    }
    void IHttpModule.Dispose() { }
    protected void context_PreSendRequestHeaders(object sender, EventArgs e) {}
}

确保在 Web.Config 中注册它:

   <system.webServer>
     <modules>
       <add name="BlankModule" type="BlankModule"/>
     </modules>
   </system.webServer>

注册该模块的另一个副本,您将获得三倍的响应,而不仅仅是两倍。

这不一定是 Orchard.Cache.Contrib 中的错误;ASP.NET 结合缓冲响应过滤器处理 PreSendRequestHeaders 的方式更可能是一个错误。

不幸的是,ImageResizer 方面没有简单的解决方法,因为 ImageResizer 需要能够为 IIS 提供的文件设置正确的 mime 类型,这意味着 PreSendRequestHeaders。

错误报告:

于 2013-03-22T13:35:15.503 回答