In webforms view engine any c# code which is used on the ASCX file will be run on every hit. Thats why we should keep any processing or data access inside code behind so that it can be cached.
How does it work in razor files? They do not seem to have code behind files.
Razor - Output Caching
Hi there
In webforms view engine any c# code which is used on the ASCX file will be run on every hit. Thats why we should keep any processing or data access inside code behind so that it can be cached.
How does it work in razor files? They do not seem to have code behind files.
Thanks
You can cache inline Razor macros by adding a Cache="300" (where 300 is the time in seconds you want to cache content for). eg.
This doesn't seem to work for non-inline Macros. See http://our.umbraco.org/forum/developers/razor/17838-inline-razor-macro-caching
is working on a reply...