9

Sitecore's HTML caching can be disabled through the cacheHtml parameter on the website's definition. This is handy for a preview site that directly reads from the Master database.

Can the same be done for the GlassMapper cache?

1 Answer 1

13

Yes, use the glassCache attribute. A value of anything other than false means the cache will be enabled for that site:

https://github.com/mikeedwards83/Glass.Mapper/blob/master/Source/Glass.Mapper.Sc/SitecoreService.cs#L116

4
  • I actually want to do the opposite of this and ensure Glass cache is working. I'm assuming then if the attribute isn't there Glass will be caching things? I've read into this though Cardinal Core says Glass doesn't cache in preview or in edit mode (cardinalcore.co.uk/2015/04/05/glass-mapper-v4-caching). This may be the root of my Experience Editor performance issues. Does anyone know how to turn on Caching in glass for Page Editor too? Commented Oct 6, 2016 at 11:29
  • 1
    If you look at the code linked above, it specifically disables the cache for Experience/Page Editor, so it can't be enabled. It's generally not advisable to cache in the editor, because when changes are made within Sitecore then they won't be reflected. If this is causing you performance issues I would see if you can find the underlying issue of what is executing slowly. Remember that caching is meant to be the icing on the cake of performance, your site should still run without it, and certainly well enough to be editable.
    – Kasaku
    Commented Oct 6, 2016 at 11:44
  • Hi Kasaku - In that case this could be the problem with the question I've posted here: sitecore.stackexchange.com/questions/261/…. We get a 6-7 second load time of new components when we add them to the page (even the same one multiple times). I am wondering if Item Caching is working properly or If I need to configure the pre-fetch cache. Commented Oct 6, 2016 at 13:27
  • Have you checked on this issue? kb.sitecore.net/articles/549951 If you have a large number of items in your tree, this query can become quite slow.
    – user571
    Commented Oct 6, 2016 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.