|
|
Rank: Devotee
Joined: 10/30/2007 Posts: 84 Location: Israel
|
Hi all,
I would really like to understand how the caching works in umbraco. It is my understanding that the nodes are being cached forever automatically, but whats the case with related files, such as images, css stylesheets or external script files?
Pages that are based on dynamic XSLT that uses parameters in the query string to present data (using XSLT extensions for example - without accessing the umbraco nodes), how are they being cached?
Is the backend cached at all? its images, css, scripts, anything?
Where would you suggest to apply IIS caching to aid site perfomance?
Is there a way to change any of the caching preferences?
I would appreciate any comments on this, especially from the core team...
Itamar.
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,074 Location: Charleston, West Virginia, United States
|
Itamar Syn-Hershko wrote: Hi all,
I would really like to understand how the caching works in umbraco. It is my understanding that the nodes are being cached forever automatically, but whats the case with related files, such as images, css stylesheets or external script files?
Pages that are based on dynamic XSLT that uses parameters in the query string to present data (using XSLT extensions for example - without accessing the umbraco nodes), how are they being cached?
Is the backend cached at all? its images, css, scripts, anything?
Where would you suggest to apply IIS caching to aid site perfomance?
Is there a way to change any of the caching preferences?
I would appreciate any comments on this, especially from the core team...
Itamar.
Hi Itamar, I will try to explain the various caching elements to the best of my ability, so, if someone sees that I missed something, please correct me. umbraco caches the nodes in memory since this is a bulk of the request to be generated. This is the umbraco.config file in the data folder. As for other files, such as css, images, and other static content, IIS would handle the caching of those, as they are just static files. So, setting up some settings here would help out a little, but be careful, as you can potentially break the admin panel. Perhaps turn off caching for the umbraco folder... Templates are cached as well using the .NET caching controls. For XSLT and User Controls, umbraco has the capability of caching their results by page and by user. This allows for personalization of the cache results. This too is handled by the .NET cache controls. I am not aware of any ways to configure the caching that umbraco does other than a few settings that now allow you to skip the umbraco.config file. Look in the config folder for the various configuration files, and umbracoSettings.config may have something you are looking for. As for overall performance, I have not experienced any problems with umbraco running on any site, even high traffic sites. In my experience, the SQL DB is the only problem, and it is typically only noticeable in the admin panel. I only had problems on shared SQL installations where the DB server contained hundreds of SQL databases, which had a rogue process from time to time. Hope this helps a bit. Case
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|
|
Rank: Devotee
Joined: 10/30/2007 Posts: 84 Location: Israel
|
Casey Neehouse wrote: umbraco caches the nodes in memory since this is a bulk of the request to be generated. This is the umbraco.config file in the data folder.
Just out of curiosity - the cache is just an XML file stored on the file system, that umbraco loads when needed instead of accessing the DB? I thought it would be constantly stored in some sort of data container (this is what I understood from conversations I had with someone). Then is this XML file always loaded, or only accessed when a request is made? Casey Neehouse wrote: As for other files, such as css, images, and other static content, IIS would handle the caching of those, as they are just static files. So, setting up some settings here would help out a little, but be careful, as you can potentially break the admin panel. Perhaps turn off caching for the umbraco folder...
I'm not very familiar with the IIS caching abilities, can it be set to cache only images and js/css files? that way I will boost both the hosted site and the admin panel, and the admin panel will still perform great since I'm not handling the aspx pages at all. Casey Neehouse wrote: For XSLT and User Controls, umbraco has the capability of caching their results by page and by user. This allows for personalization of the cache results. This too is handled by the .NET cache controls.
This is the part that I'm most interested in, and which I can't understand. If I have a page that uses XSLT in this form: http://www.mysite.com/my_module/loaddata/id/234and I use the XSLT to load some data from another DB, say, with the id of 234. How would the caching work for this URL? would it work differenly if I used an .aspx extension or passed the variables in the querystring? practically, what does it mean by user, and where do I go to configure this? Casey Neehouse wrote: I am not aware of any ways to configure the caching that umbraco does other than a few settings that now allow you to skip the umbraco.config file. Look in the config folder for the various configuration files, and umbracoSettings.config may have something you are looking for.
As for overall performance, I have not experienced any problems with umbraco running on any site, even high traffic sites. In my experience, the SQL DB is the only problem, and it is typically only noticeable in the admin panel. I only had problems on shared SQL installations where the DB server contained hundreds of SQL databases, which had a rogue process from time to time.
Hope this helps a bit.
Case
Isn't there a way to explicitly include or exclude nodes from being cached? This means the umbraco weak link is at its admin panel; this I could feel when testing the system at several installations, and thats why I'm looking into caching what I can. I hope the undergoing work on the indexing and relations will boost the DB performance somewhat. Thanks for the info. Itamar.
|
|
 Rank: Fanatic
Joined: 7/20/2006 Posts: 408 Location: Amsterdam
|
Adding those indices can be helpfull: http://forum.umbraco.org/misc/database-indicesI did some database tuning, especially the time consuming queries
|
|
 Rank: Fanatic
Joined: 7/20/2006 Posts: 408 Location: Amsterdam
|
Adding those indices can be helpfull: http://forum.umbraco.org/misc/database-indicesI did some database tuning, especially the time consuming queries
|
|
Rank: Devotee
Joined: 10/30/2007 Posts: 84 Location: Israel
|
Thanks Sjors.
Casey any word on the above? Especially I'm interested in knowing whether the XML cache file is being loaded all the time by umbraco, or only accessed when a request is being made?
Itamar.
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 789 Location: Århus, Denmark
|
The umbraco.config cache file is created when the site restarts. Then the xml is loaded into memory(ram) where it is much faster accessed by the system. So umbraco doesn't physically read the umbraco.config file on every request, since it is allready storen in RAM.
|
|
Rank: Devotee
Joined: 10/30/2007 Posts: 84 Location: Israel
|
Thanks. Can you comment on the rest of the points above as well please?
Itamar.
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 789 Location: Århus, Denmark
|
I'm afraid I'm not familiar with the other cache aspects of umbraco, so I can't help you there :hmm:
|
|
Rank: Devotee
Joined: 10/30/2007 Posts: 84 Location: Israel
|
OK I appreciate your help then. Anyone else with understanding of caching with umbraco?
Itamar.
|
|
 Rank: Umbracoholic
Joined: 7/20/2006 Posts: 1,074 Location: Charleston, West Virginia, United States
|
Hi Itamar, Sorry I did not respond earlier. I got busy and the email got lost along the way. As Morten said, umbraco loads all published nodes into the umbraco.config file, which is then loaded into memory for fast access. As you publish and unpublish, the memory is updated (and the file can be as well) along the way. The XML file is not directly accessed by anything other than the admin area, or when the app starts. IIS caching is a complex subject, and best to be researched fully before messing with it too much. Basically, IIS will cache some objects in memory for fast delivery, etc. IIS can also set headers to the browser for certain files to alleviate redundant downloads. I know just enough to know about it. Quote:This is the part that I'm most interested in, and which I can't understand. If I have a page that uses XSLT in this form: http://www.mysite.com/my_module/loaddata/id/234and I use the XSLT to load some data from another DB, say, with the id of 234. How would the caching work for this URL? would it work differenly if I used an .aspx extension or passed the variables in the querystring? practically, what does it mean by user, and where do I go to configure this? I am not following your question completely, but I will try to answer anyhow. If you are using a user control or xslt, and have it set to cache, it will cache the results of the control for the determined time. This basically means that if you are pulling content from a remote site (a), and displaying it on another site (b), and b has it cached for 5 minutes, site a will not receive any requests for that data as long as it is still cached. Once the cache expires, the data will be refreshed. As for the question about it working for a specific url, I am not exactly sure. You may have to set it to cache by page, but I am not sure if that is by umbraco's definition of a page (IE a node), or by a unique url. My guess is no, that it is by umbraco pages. As for including and exluding nodes from cache, there is not a way to exclude them at the moment. I am not sure I understand you purpose of this request, but, nodes can be published and unpublished. Umbraco runs the content cached to allow for very fast load times. Content and templates are the only parts that are automatically cached in to memory, as they are static in nature. Macros must be told to cache, and how. These are the dynamic parts, and have the potential to change. CSS, js, images, pdf, and other media files are not cached by umbraco, but rather handled directly by IIS. Umbraco can not control these files as they are not handled with .NET. I hope I answered your questions. How large of a site are you looking at running?
• 2007/2008 MVP • 2008/2009 MVP • Certified • Licensing • Support • Development • Hosting •
|
|
Rank: Devotee
Joined: 10/30/2007 Posts: 84 Location: Israel
|
Casey Neehouse wrote: I am not following your question completely, but I will try to answer anyhow.
If you are using a user control or xslt, and have it set to cache, it will cache the results of the control for the determined time. This basically means that if you are pulling content from a remote site (a), and displaying it on another site (b), and b has it cached for 5 minutes, site a will not receive any requests for that data as long as it is still cached. Once the cache expires, the data will be refreshed.
As for the question about it working for a specific url, I am not exactly sure. You may have to set it to cache by page, but I am not sure if that is by umbraco's definition of a page (IE a node), or by a unique url. My guess is no, that it is by umbraco pages.
As for including and exluding nodes from cache, there is not a way to exclude them at the moment. I am not sure I understand you purpose of this request, but, nodes can be published and unpublished.
Umbraco runs the content cached to allow for very fast load times. Content and templates are the only parts that are automatically cached in to memory, as they are static in nature. Macros must be told to cache, and how. These are the dynamic parts, and have the potential to change. CSS, js, images, pdf, and other media files are not cached by umbraco, but rather handled directly by IIS. Umbraco can not control these files as they are not handled with .NET.
I hope I answered your questions.
How large of a site are you looking at running?
Better late than never, this is what they say here at Israel :) I'm still at the very first and basic stages of learning how to use Umbraco, and I'm trying to learn the basics well before I'm starting to develop anything in particular. I'm planning on using it for several purposes, mainly on large content sites with hundreds to thousands of documents, which I will load using the XSLT extension from an external table, since I don't need them all cached. However, I do need certain caching functionalities (for example for the most accessed documents), so this is why I'm asking if this can be done from umbraco, and if not I will need to code my own caching mechanism for this extension. In my question I assumed the query string parameters can be made a part of the URL with Umbraco (flat URLs if I recall correctly?). When you say I may need to "set it" to cache by page, what do you mean? how this could be set? As for the media part of umbraco, as well as to the static files (images and such) which are part of the umbraco admin panel, do you think I could tweak their caching through IIS somehow? A bit off topic, but can I safely rename the umbraco admin panel folder to something less obvious? Itamar.
|
|
 Rank: Fanatic
Joined: 11/24/2006 Posts: 322 Location: Stockholm, Sweden
|
I suspect that I have problems with caching. I have a site hosted with a web service provider and usually the server is fast to respond and has no problems delivering the content. But sometimes, when I have not visited the site for a long time and I fire up my browser and go to the site, the initial response time can be up to 10 seconds. After that surfing the site is fast as usual. Now I suspect that the web server unloads the memory held by my web application (Umbraco) after a certain time of inactivity. I guess this would mean that it also unloads the XML-structure that it keeps in the server RAM? When the first request comes (after the inactivity) the web server would have to access the database(?) and restore the structure in the RAM cache? That would explain the initial response delay. As you see there are a lot of questionmarks and guesses so I'm basically asking for a confirmation of this theory. I'm also interested in a solution to my problem - can I add something to the web.config or ask my web service provider to alter a setting in IIS? Thanks in advance! /Thomas
Web Developer at Kärnhuset - http://www.karnhuset.net - Stockholm, Sweden
|
|
 Rank: Addict
Joined: 7/19/2006 Posts: 789 Location: Århus, Denmark
|
Hi Thomas I think you are right on the money. The application will typically shut down after a while, and the 10 seconds is not unusual for starting up the application again. I don't think that caching is the answer, but maybe rather adding some sort of "ping" that keeps our site alive? Umbraco does try to do this itself, but it obviously can't do this when it is not running. Maybe you could use an external ping service to fetch a page every x seconds or minutes so that the application does not shut down?
|
|
|
Guest |