|
|
Rank: Fanatic
Joined: 7/20/2006 Posts: 256 Location: Boston, Massachusetts
|
I am working on a site which has lots of content (over 1500 nodes, the umbraco.xml file is 14 MB), and I’d be very grateful for tips on how to optimize performance.
Can someone point me to tips on caching with Umbraco? Are there other performance optimizing strategies I should consider?
Currently, I’m testing the Son of Suckerfish dropdown menus (http://htmldog.com/articles/suckerfish/dropdowns/). When I create menus which provide access to the entire site map, site performance takes a huge hit. This seems like a good place to cache content, but I can’t get the settings to do anything.
Thanks! Tom
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 492 Location: Göteborg, Sweden
|
Hi Tom! Since all content in umbraco is cached serverside allready I guess that you are talking about the client cache here, is that correct !?
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,074 Location: Charleston, West Virginia, United States
|
If you are referring to the Macro cache, try setting the cache time a bit higher, like 300 for 5 minutes, 600 for 10 minutes, etc. I am not sure about the cache types, but think that un-checking them all will cache the macro once for all pages and users. The interface is a bit vague on this, but my reasoning would suggest that if you wanted it to render differently per page, you would have to cache it on each page, thus the "Cache By Page" option. If it changes per user, then "Cache Personalized". Heck, I am confused now.. Hope this helps. Case
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|
|
 Rank: Aficionado
Joined: 7/19/2006 Posts: 164
|
Hi Tom I could not either seem to get the caching to work on a marco with a webcontrol via the build in caching checkboxes. This I how do caching on webcontrols protected override void Render(HtmlTextWriter output) { string cacheKey = "Your_Cache_Key"; string cachedString = (string)System.Web.HttpContext.Current.Cache[cacheKey]; if (cachedString == null) { cachedString = "macro cached " + DateTime.Now; System.Web.HttpContext.Current.Cache.Insert(cacheKey, cachedString, new System.Web.Caching.CacheDependency(System.Web.HttpContext.Current.Server.MapPath("/media/xmlChanged.txt"))); } output.Write(cachedString); } The file /media/xmlChanged.txt gets touched when a publish are done. That means that your menu could get cached until a page has been published, this is pretty nice You can see my project where I use this caching on the svn : CPalm.SyntaxHighlighter under umbraco-extensions Regards/Christian www.cpalm.dk
CPalm, www.cpalm.dk
|
|
 Rank: Aficionado
Joined: 7/19/2006 Posts: 164
|
hmm, what are you trying to cache? xslt or a webcontrol
CPalm, www.cpalm.dk
|
|
 Rank: Administration
Joined: 7/25/2006 Posts: 415 Location: vipperoed, denmark
|
Umbraco's macro caching has a bug and does not work - according to Niels. I think it will be back around 3.0 Jesper webbureau jesper.com doing webdesign / development / umbraco implementations / 2007&2008 MVP
|
|
Rank: Fanatic
Joined: 7/20/2006 Posts: 256 Location: Boston, Massachusetts
|
Thanks for the comments. I am trying to cache essentially the site map for navigation. Its built with XSLT, and it should be the same on every page (since its the site map).
I won't be able to test any suggestions until Monday, but I will follow up on any success or with more quetions.
Thanks!
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 492 Location: Göteborg, Sweden
|
Why not make the tree structure in a file of it's own and load with javascript? That way it would at least be cached client side !? You can use the content type function to make any page into a javascript file...
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
Rank: Fanatic
Joined: 7/20/2006 Posts: 256 Location: Boston, Massachusetts
|
Thanks again for the comments in this thread. I wanted to follow up because since Friday, my cache issue seems to have resolved itself (just needed the weekend off, I guess).
The sitemap I'm using for the navigation is an XSLT macro, and on Friday I set the cache options to - Cache Period: 3600 Cache By Page: checked Cache Personalized: unchecked.
As I've stated, these settings didn't do anything on Friday but they work perfectly now and performance is excellent. I assume that either the umbraco.xml in memory was rebuilt or perhaps IIS restarted to account for the change. Would that make sense?
Thanks, Tom
|
|
Rank: Enthusiast
Joined: 8/15/2006 Posts: 17 Location: Melbourne, Australia
|
I think you'll find that the content will become stale if you load the macro from cache vs loading directly. We had a latest news macro that would sometimes show the latest news and sometimes show older news - adding the trace cmd to the query string showed the old content was being shown when the macro was pulled from cache. Looking very quickly over macro.cs, can't see where the macro should expire and refresh - just loads it and never refreshes. Was only quick look, but as suggested above, caching macros does have some issues :)
Cheers, Karl
|
|
|
Guest |