My real query is that Partial Views in Umbraco do not have caching options therefore does this not mean they are slower than Macro Scripts, or do they already have caching enabled via some other method?
Both macroscripts and partial views are only querying cached content. The updates to partial view querying makes them faster than macroscripts actually (as those are now considered "obsolete" and haven't been optimized for a long time).
To make it even better the exact same partial view querying can be used in partial view macros and as you may or may not now, macros can be configured to use extra caching so the query will only be done once and the result will be held in memory for the amount of time configured on the macro.
Partial View versus Razor Macro Scripts
I have been thinking about Partial Views vs Razor macro scripts and how they differ and Doug gave a good description on the following link:
http://our.umbraco.org/forum/developers/razor/44664-Confused-over-when-DynamicNodeList-is-returned?p=0#comment160691
My real query is that Partial Views in Umbraco do not have caching options therefore does this not mean they are slower than Macro Scripts, or do they already have caching enabled via some other method?
Both macroscripts and partial views are only querying cached content. The updates to partial view querying makes them faster than macroscripts actually (as those are now considered "obsolete" and haven't been optimized for a long time). To make it even better the exact same partial view querying can be used in partial view macros and as you may or may not now, macros can be configured to use extra caching so the query will only be done once and the result will be held in memory for the amount of time configured on the macro.
Hope this helps!
Partials can also be cached. You use the @Html.CachedPartial syntax eg.
If you just want to access the current page model then you can just use:
or even
See bottom of http://our.umbraco.org/documentation/Reference/Templating/Mvc/partial-views
The partial cache gets cleared any time any page is published, so you can effectively cache a partial for as long as you want.
is working on a reply...