Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6050105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:39:05+00:00 2026-05-23T07:39:05+00:00

I want to disable the html cache for 1 item so it is always

  • 0

I want to disable the html cache for 1 item so it is always rendered.

Background:

I need to show information for companies stored in a separate database. In sitecore I have 1 item which has the user control that shows the required information and depending on a Context parameter I figure out which company to show.

The sitecore tree look like this:

/sitecore
  /content
    /home
      /company-information

The url is: /show-company-information/[company-name]-[company-id]. I have a pipeline module that parses the url and sets the company information as the current item and adds the company id to HttpContext.Current.Items. That’s how my user control figures out which company information to render.

It all works fine in development but once you deploy it to a Content Delivery server it stops working correctly. The first time the page is accessed it gets cached and every consecutive request returns the company information that was cached the first time.

My current workaround is to clear the HTML cache for the company-info item in the same pipeline step that parses the company-information but it seems a really dirty solution.

Is there a better way to achieve the same result?


EDIT

Here is how the site is setup in web.config and also the web database configuration:

<site name="website" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content/Home/" startItem="/home" language="en-GB" database="web" domain="extranet" loginPage="/user-login.aspx" allowDebug="true" cacheHtml="true" htmlCacheSize="400MB" registryCacheSize="500KB" viewStateCacheSize="500KB" xslCacheSize="20MB" filteredItemsCacheSize="20MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" />

<!-- CACHE SIZES -->
    <cacheSizes>
      <sites>
        <website>
          <html>500MB</html>
          <registry>500KB</registry>
          <viewState>500KB</viewState>
          <xsl>200MB</xsl>
        </website>
      </sites>
    </cacheSizes>

<database id="web" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel">
    <param desc="name">$(id)</param>
    <icon>Network/16x16/earth.png</icon>
    <securityEnabled>true</securityEnabled>
    <dataProviders hint="list:AddDataProvider">
      <dataProvider ref="dataProviders/main" param1="$(id)">
        <disableGroup>publishing</disableGroup>
        <prefetch hint="raw:AddPrefetch">
          <sc.include file="/App_Config/Prefetch/Common.config" />
          <sc.include file="/App_Config/Prefetch/Web.config" />
        </prefetch>
      </dataProvider>
    </dataProviders>
    <indexes hint="list:AddIndex">
      <index path="indexes/index[@id='articleIndex']" />
    </indexes>
    <proxiesEnabled>false</proxiesEnabled>
    <proxyDataProvider ref="proxyDataProviders/main" param1="$(id)" />
    <archives hint="raw:AddArchive">
      <archive name="archive" />
      <archive name="recyclebin" />
    </archives>
    <Engines.HistoryEngine.Storage>
      <obj type="Sitecore.Data.$(database).$(database)HistoryStorage, Sitecore.Kernel">
        <param connectionStringName="$(id)" />
        <EntryLifeTime>30.00:00:00</EntryLifeTime>
      </obj>
    </Engines.HistoryEngine.Storage>
    <cacheSizes hint="setting">
      <data>400MB</data>
      <items>400MB</items>
      <paths>10MB</paths>
      <standardValues>1MB</standardValues>
    </cacheSizes>
  </database>
</databases>

Page layouts structure:

layout - no output caching
  - sublayout - no caching options ticked
    - offending sublayout - no caching options ticked

Are we doing anything wrong for this to be cached so aggressively?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:39:06+00:00Added an answer on May 23, 2026 at 7:39 am

    You can use the CacheManager to turn off caching during the Page Load event then turn it back on in PreRender. This will ensure that the page’s html / xslt controls are not cached.

    The CacheManager Class has the following method used by all controls when retrieving HTML caches

    /// <summary>
    /// Gets the HTML cache.
    /// </summary>
    /// <param name="site">The site.</param>
    /// <returns>The HTML cache.</returns>
    public static HtmlCache GetHtmlCache(SiteContext site)
    {
      if (_enabled && (site != null))
      {
        return site.Caches.HtmlCache;
      }
      return null;
    }
    

    So setting the Enabled Property to false will stop the controls being rendered from the cache:

    CacheManager.Enabled = false;
    

    Its brutal but it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to disable users from entering a character into a HTML text input
I want to disable the tab key in my HTML form. I found following
I want to disable mouse right click on an HTML page. I have a
I want to disable the ESC key in an HTML page. How can I
I want to set disable attribute based on a condition for Html.TextBoxFor in asp.net
When the user submits an HTML form, I want to disable the form while
I want to disable the HTML editor(Tiny MCE/Xstandard lite 2.0) and enable Editor -
I want to interpret html pages scripts, but want to disable any posibility of
I want disable HTML button depending on value present in Spring bean.I am using
I want to disable the referenced control in the HTML and javascript below, yet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.