November Happy Hour will be moved to Thursday December 5th.

Should I cache PageData that is often fetched?

Vote:
 

I have created a page that will hold reuseable properties for translations throughout the site.

I get the properties from this page with the help of a HtmlHelper.

public static class TranslationHelper
  {
    public static PageDataBase TranslationPage(this HtmlHelper html)
    {
      var contentLoader = ServiceLocator.Current.GetInstance<IContentLoader>();
      var translationsPageId = WebConfigurationManager.AppSettings.Get("TranslationsPageId");
      var page = contentLoader.Get<PageDataBase>(new PageReference(translationsPageId));

      return page;
    }
  }

    Could there be a performance hit if this code gets called several times on a page? Should I save/cache the PageData?

#78049
Dec 02, 2013 22:13
Vote:
 

EPiServer does a good job caching PageData objects out of the box. For some details take a look at this post: How EPiServer CMS caches PageData objects.

Frederik

#78051
Dec 02, 2013 22:22
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.