Skip to main content
The 2024 Developer Survey results are live! See the results
29 votes
Accepted

How do I clear the HTML cache for a specific user?

You can do this by making sure that your renderings are set to Vary by User. This adds the user to the cacheKey string like this "_#user:" + Context.GetUserName(); You can then use the following code ...
Richard Seal's user avatar
  • 20.6k
19 votes

How can I safely clear the media cache on a production sitecore CD instance?

Other option is to delete from time to time media cache using an schedule agent. Current value is 24 days but if you need to clear more ofen just decrease max age parameter of the last setting (see ...
Vlad Iobagiu's user avatar
  • 18.6k
18 votes
Accepted

How can I safely clear the media cache on a production sitecore CD instance?

It is completely safe to just delete the folder /App_data/MediaCache without causing disruption. The minute an image gets called up again, it will be cached again, so no worries about the ...
Dilyano Senders's user avatar
18 votes

Disable HTML cache for development

You can turn cache off at the site level in the site definition in configuration: <site name="website" enableTracking="true" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content" ...
sestocker's user avatar
  • 1,697
17 votes

Sitecore Page - First request on every page slow

It could be that you just have a dodgy rendering that is running on every page and is then cached for that page; to see if this is the case you can profile Sitecore pages. You can investigate this by ...
Steven Newstead's user avatar
17 votes
Accepted

Clearing CD cache in code from the CM

I would use a remote event that can be raised on the CM server and subscribed to by the CD servers. When the event is raised, an event handler can execute on the CD servers clearing the cache. This ...
Kasaku's user avatar
  • 4,184
16 votes
Accepted

What is the difference between the item, prefetch and html caches?

Prefetch cache This is item data pulled out from the database when the site starts up - from the Sitecore docs: "Each database prefetch cache entry represents an item in a database. Database ...
Steven Newstead's user avatar
16 votes
Accepted

Disable HTML cache for development

I typically disable caching for my local environment by setting the HTML cache lifetime to 1 second using the following config patch: <setting name="Caching.HtmlLifetime"> <patch:attribute ...
Derek Hunziker's user avatar
15 votes
Accepted

How can I know that the Html Cache on the CD is Cleared on Publish

Just for clarification of how HTML cache works, the remote CD servers need to know about the CM server publish event. That setting is EnableEventQueues. If it is set to true on the remote server, the ...
Chris Auer's user avatar
  • 13.1k
14 votes
Accepted

Sitecore Html Caching Strategy

Vary By options each serve different use cases, and are not always applicable when caching a rendering. If a component doesn't have a data source then Vary By Data will cache its output by the ...
Nathan Hase's user avatar
13 votes
Accepted

Can GlassMapper caching be disabled at a site level?

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/...
Michael Edwards's user avatar
12 votes

Sitecore Page - First request on every page slow

Possible answers to 1,2,3... Sounds like you need to do a bit of tuning on your caches. Sitecore has a number of "admin" pages which help you diagnose problems such as this - you can use the cache ...
Phil Burton's user avatar
  • 1,314
12 votes
Accepted

Log file warning about caching and DefaultScavengeStrategy

The DefaultScavengeStrategy is responsible for scavenging (freeing up) memory from your caches when your application is maxing out on its memory resources, as determined by the configured cache size ...
Zachary Kniebel's user avatar
10 votes

Disable HTML cache for development

I typically do what you're doing and set all the renderings I want cached to be cacheable. However, for my local development, I will set cacheHtml to false on the site definition. <configuration ...
Nick's user avatar
  • 171
10 votes
Accepted

Locking down Sitecore rendering caching

You can remove access to /sitecore/templates/System/Layout/Rendering Parameters/Standard Rendering Parameters/Caching Navigate to the item Open Security tab Click on Assign button In the dialog which ...
Szymon Kuzniak's user avatar
10 votes
Accepted

How do I get to know the CD server Cache details

If you are using Sitecore 8.0 Update 3 upwards then a couple of new default processors were added to the Health Monitors to periodically dump the Cache Status and Rendering Statistics to files on disk....
jammykam's user avatar
  • 13.9k
9 votes
Accepted

Sitecore Implementation - HTML Cache Control Setting options

Sitecore comes with out of the box possibilities to configure media caching. Have a look at the Sitecore.config: <!-- MEDIA RESPONSE - CACHEABILITY The <see cref="HttpCacheability">...
Koen Heye's user avatar
  • 1,626
9 votes
Accepted

How to disable caching for specific items in the Media Library?

I would recommend solving this by embracing HTTP caching by changing the Cache-Control to no-cache. The browser will then always check to see if there's a newer/different version but since media items ...
Richard Szalay's user avatar
9 votes

Html cache clear error after upgrade Sitecore from 9.0.2 to 9.3

Adding to @Gatogordo's answer, you may have a site configuration which includes the HtmlCacheClearer instead, such as: <events> <event name="publish:end"> <handler type="Sitecore....
nickwesselman's user avatar
8 votes
Accepted

Sitecore pre-fetch cache setting clarification

Do we need to include both master and web db settings in CMS? Or just master settings in CMS. Only the master db will suffice. Web db items are only used when the site is accessed through the front-...
Ruud van Falier's user avatar
8 votes
Accepted

How to configure caching for static resources in Sitecore

Option #3 actually does work. I forgot to do a hard refresh in my browser during testing. Oops. So you can add this to your main web.config <configuration> <location path="themes"> ...
Matthew Dresser's user avatar
8 votes
Accepted

Creating a very large footer menu efficiently

The question is quite broad and there are many ways you can achieve this obviously (you mentioned sitecore query and foreach loop). Another option would be to use the sitecore content search (with ...
Andrey Bobrov's user avatar
8 votes
Accepted

Glass Mapper language caching

If Cachable attribute equals true, it means that Glass Mapper will apply cache for this object. I've decompiled the Glass.Mapper.Sc.dll, where CacheKeyGenerator is defined and we can see that it doesn'...
Artem Prashkovich's user avatar
8 votes

Log file warning about caching and DefaultScavengeStrategy

If you do not want to disable cache size limits (which in our situation can cause memory issues when building large indexes on Azure WebApps), you can use the following Sitecore setting to change the "...
Xuntar's user avatar
  • 505
8 votes
Accepted

Forcing Sitecore to clear the cache for updated images

Adding a unique URL parameter will force the browser to request the updated image, as mentioned by both the other answers. You'll also face this same issue if you are using a CDN by the way and using ...
jammykam's user avatar
  • 13.9k
7 votes
Accepted

What does the DisableBrowserCaching setting actually disable?

You have it right, the Page refers to the fully rendered HTML Markup of the page. This would include all renderings on that page that are not ajax'd in after the page load in the browser. media, CSS ...
Richard Seal's user avatar
  • 20.6k
7 votes

How can I safely clear the media cache on a production sitecore CD instance?

I have just manually deleted the folders under App_Data/MediaCache/[site name] on each CD server. Never seems to have caused disruption since Sitecore will fetch the image from the database again if ...
Ed Schwehm's user avatar
  • 3,036
7 votes
Accepted

How to Disable Cache for One Page

Rather than disable the HTML cache for that page, why not use the Vary by Query String option on your query-string-dependent renderings? I wrote an article that should help get you started, but the ...
Zachary Kniebel's user avatar
7 votes
Accepted

When should the HtmlCacheClearAgent be enabled?

The cache is typically cleared when publishing, which would happen frequent enough for you to not enable this agent. Imagine a case where you don't want the cache to be cleared, perhaps due to the ...
Michael West's user avatar
  • 18.3k
7 votes

How do i clear the cache of the item after publishing

If you are referring to HTML Cache, by default, Sitecore includes cache-clearing event handlers that clear the HTML cache when the publish:end and publish:end:remote events are raised. The handler is ...
Zachary Kniebel's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible