Base class for a service providing data for an API controller on a 8.2 update-4 instance.
Code's context is the web database and it's a simple case of using content search to find an item based on a query of its fields and then using the context to get the item with its Glass interface. (Context being ISitecoreContext injected into the contructor)
var doc = result.Document;
var model = Context.GetItem<TGlass>(doc.ItemId.Guid);
All standard Sitecore caching is active and the Glass interface has caching enabled on its type attribute.
Nothing is cached when the code runs. Checked Sitecore.Context.Site.Properties["glassCache"] and by manually updating the web db item with small changes which are immediately shown upon refresh.
Is there anything obvious that I am missing?
[SitecoreType(Cachable = true, TemplateId = Templates.Tip.ID, EnforceTemplate = SitecoreEnforceTemplate.Template)]
public interface ITip: IApiDataItem
{
[SitecoreField(FieldId = Templates.Tip.Fields.Title)]
string Title { get; set; }
[SitecoreField(FieldId = Templates.Tip.Fields.Summary)]
string Summary { get; set; }
[SitecoreField(FieldId = Templates.Tip.Fields.Overview, Setting = SitecoreFieldSettings.RichTextRaw)]
string Overview { get; set; }
[SitecoreField(FieldId = Templates.Tip.Fields.Highlight)]
string Highlight { get; set; }
[SitecoreField(FieldId = Templates.Tip.Fields.Why)]
string Why { get; set; }
[SitecoreField(FieldId = Templates.Tip.Fields.Body, Setting = SitecoreFieldSettings.RichTextRaw)]
string Body { get; set; }
[SitecoreField(FieldId = Templates.Tip.Fields.Category)]
Taxonomy.Models.ICategoryItem Category { get; set; }
[SitecoreField(FieldId = Templates.Tip.Fields.Type)]
Taxonomy.Models.ICategoryItem Type { get; set; }
[SitecoreField(FieldId = Templates.Tip.Fields.Image)]
Media.Models.IFrontEndImage Image { get; set; }
[SitecoreField(FieldId = Templates.Tip.Fields.AssociatedAnswers)]
IEnumerable<IAnswer> AssociatedAnswers { get; set; }
}