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 ...
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 ...
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 ...
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" ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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 ...
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 ...
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 ...
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....
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">...
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 ...
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....
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-...
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">
...
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 ...
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'...
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 "...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
caching × 155publishing × 19
sxa × 18
media-library × 12
performance-optimization × 9
glass-mapper × 8
html-caching × 7
paas × 6
presentation × 5
personalization × 5
content-delivery × 5
performance × 5
sitecore-client × 4
azure × 4
configuration × 4
jss × 3
session-state × 3
events × 3
redis × 3
cdn × 3
content-editor × 2
security × 2
upgrade × 2
mvc × 2
multilingual × 2