mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 11:44:41 +08:00
Enabling Collection caching more query caching
--HG-- branch : NH3
This commit is contained in:
@@ -325,6 +325,8 @@ namespace Orchard.ContentManagement {
|
||||
contentItemVersionCriteria.SetResultTransformer(new DistinctRootEntityResultTransformer());
|
||||
}
|
||||
|
||||
contentItemCriteria.SetCacheable(true);
|
||||
|
||||
return contentItemVersionCriteria.List<ContentItemVersionRecord>();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace Orchard.Data.Conventions
|
||||
public void Apply(IOneToManyCollectionInstance instance)
|
||||
{
|
||||
instance.Fetch.Select();
|
||||
instance.Cache.NonStrictReadWrite();
|
||||
}
|
||||
|
||||
public void Accept(IAcceptanceCriteria<IOneToManyCollectionInspector> criteria)
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Orchard.Data {
|
||||
}
|
||||
|
||||
public virtual IQueryable<T> Table {
|
||||
get { return Session.Query<T>(); }
|
||||
get { return Session.Query<T>().Cacheable(); }
|
||||
}
|
||||
|
||||
#region IRepository<T> Members
|
||||
|
||||
@@ -93,7 +93,9 @@ namespace Orchard.Data {
|
||||
var config = _sessionConfigurationCache.GetConfiguration(() =>
|
||||
_dataServicesProviderFactory
|
||||
.CreateProvider(parameters)
|
||||
.BuildConfiguration(parameters));
|
||||
.BuildConfiguration(parameters)
|
||||
.Cache( c => c.RegionsPrefix = _shellSettings.Name)
|
||||
);
|
||||
|
||||
#region NH-2.1.2 specific optimization
|
||||
// cannot be done in fluent config
|
||||
|
||||
Reference in New Issue
Block a user