Craig Taylor
Craig Taylor

Reputation: 1173

Glass Mapper Caching Value?

Using Sitecore 8.0u3 and Glass-Mapper 3.5.3

I've run into an interesting situation that I can't resolve. I'm seeing on certain controller renderings that some values for simple text fields(single-line, multiline) appear to be cached. Other controller renderings do not appear to have this issue.

I attempt to write out the intro text for the form like so:

<div class="intro">@Editable(m => Model.ContextItem.Intro_Text)</div>
<div>RAW: @Model.ContextItem.Intro_Text</div>

Note that the second line was added by me for troubleshooting purposes.

In this case, the result of this is:

Fill out the form to contact uss.

RAW: Fill out the form to contact uss.

I update the text in Sitecore to remove the extra 's', save and publish. I refresh my page and I see this:

Fill out the form to contact uss.

RAW: Fill out the form to contact us.

So the portion that does not use Editable works fine, but the Editable version continues to show the 'old' value.

I've looked at a lot of settings including the cacheability of the rendering, the cacheability of the site, the Caching.Enabled setting, the Caching.HTMLLifetime setting, IIS caching, publishing restrictions, but none seem to affect this issue.

Any ideas of other places to look for the source of the issue?

Upvotes: 1

Views: 1295

Answers (3)

Naveed Ahmad
Naveed Ahmad

Reputation: 445

The @Editable() looks at the HtmlString and most probably displays it from the HtmlCache. I have seen this issue as well and during build process and I have to do re-publish all to clear caches, specially when I will be making data template changes.

You can try few things in your development environment and narrow down the issue.

  1. Once you make a change, clear HTML cache from /sitecore/admin/cache.aspx and check the page again.

  2. Try doing an incremental publish to the site as it will clear HTML cache.

  3. Try doing a republishing the site.

Also, disable the output cache for the website under

Upvotes: 0

jwsadler
jwsadler

Reputation: 471

I cam across this issue a while ago. Change the syntax to be @Editable(Model => Model.ContextItem.Intro_Text)

Upvotes: 1

Wesley Lomax
Wesley Lomax

Reputation: 2077

I think you need to use the syntax <div class="intro">@Editable(m => m.ContextItem.Intro_Text)</div> rather than <div class="intro">@Editable(m => Model.ContextItem.Intro_Text)</div>

Upvotes: 7

Related Questions