Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Performance and...Performance and...Output Cache ProviderOutput Cache Provider
Previous
 
Next
New Post
8/15/2010 7:06 PM
 
Does anyone know how to use the Output Cache Provider in the page setting?
There are no providers in the dropdown.  how do I set up the providers? and is there a point to setting up page output Cache providers?


thanks
 
New Post
8/15/2010 7:20 PM
 
That is one of the numerous areas where DotNetNuke utilizes the provider model to allow you to have alternative functionality.  For example, your own Output Cache provider.  You could implement your own to have an additional performance boost and other performance support.

Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
8/17/2011 2:53 PM
 
Emedia, 

I know this is an old post - however for searches related to DNN Output Caching this is one of the top results.  This indicates to me that there is little to know information out there related to Output Caching on DotNetNuke.  The response provided to your question, in my opinion, is woefully inadequate.  You clearly asked HOW to set up providers, and seeked explanation on what (if any) the benefits of Output Caching would be.   

I've recently been tasked with DNN development, and am honestly shocked at the lack of information and degree of ambiguity that currently exists regarding Output Caching in DNN. 

That being said - I can answer your question (for internet posterity) - and will actually be asking some additional questions at the end of my reply.  All statements apply to DNN 5.6.3. 

1. The Output Caching Providers available to the system are defined in the web.config file for the site.   There is a section that should be set up as such: 

<outputCaching defaultProvider="[PROVIDER NAME HERE]">
      <providers>
        <add name="[PROVIDER NAME HERE]" type="[FULLY QUALIFIED PROVIDER NAMESPACE.CLASSNAME]" providerPath="\Providers\CachingProviders\[SOME PROJECT DIRECTORY FOR THE PROVIDER]" />
      </providers>
</outputCaching>

2. In respect to the performance gains... Output Caching, in my opinion, is probably one of the most performance enhancing mechanisms you can apply to a web application.  If implemented *CORRECTLY* (which i'm not sure DNN does) the ASP.NET application request life cycle should be short-circuited at the ResolveRequestCache event (stage 8 of 26, see http://msdn.microsoft.com/en-us/libra...) bypassing 95% of the server processing involved in handling a page request. 

The idea is that the HTML output for a page, which is ultimately generated and delivered to a web client, is tied to a key (typically some combination of URL and QUERY PARAMETERS) and cached for re-use later.  At step 8 in the lifecycle, ASP.NET checks for the existence of previously cached HTML for the request.  If it exists, it returns what was cached and aborts.  If it doesn't exist (or is expired), it proceeded as it normally would, and caches the result of its labor (for subsequent requests) at step 20. 

In short, all the work involved in generating that HTML (IIS worker process cycles, Database Calls, etc) is bypassed and content is delivered REALLY FAST. 

CAVEATS:
1. Properly implemented Output Caching should only serve cache to GET requests (not POST).  Any page handling a POST verb is likely doing some processing related to the POST data, and short-circuiting the .NET life-cycle would kill that.  You should load all dynamic pages that you wish to be cached via "GET" as opposed to "POST" and just pass any variables required to uniquely identify the content in the "GET" query string.  e.g. "/user/profile/myprofile?id=200" can be cached if it is requested as GET as GET does not imply you are doing any work against that page - just requesting its current state.   if you are loading a page with a module that POSTs back to itself that is fine - you can serve the initial GET request from cache - and bypass caching any subsequent POSTs. 

2. Ideally implemented Output Caching should be smart enough to invalidate/delete certain keys based on updates made to the site.  e.g. if you update the content of a DNN HTML module, the cache for that entire page should be invalidated right away - so that your users will see changes right away as opposed to having to wait for the Output Cache to expire.  This is an ideal requirement because some business rules will easily work under a system where changes don't become visible right away, despite that not being ideal.  

In a shopping cart for example, the url /viewcart.aspx?cartid=GUID might be cached.  If someone adds something to their cart, the site should invalidate output cache for that page/key so that the cart is updated right away. 

3. (if you aren't using a web-farm, skip this). Ideally implemented Output Caching should be smart enough to invalidate keys across a web farm.  Syncing cache across a web farm, in my opinion, is not a huge deal from a delivery standpoint.  If one server has a slightly updated cache than another for a small period of time - who cares.  Half your users might see a slightly older version of a page.  However, if you explicitly delete something from the cache - ideally that should be propagated across a web farm. 


All of that being said - I've been attempting to implement my own output caching provider for DNN 5.6.3.   

1. I've created a class which inherits from DotNetNuke.Services.OutputCache.OutputCachingProvider

2. Absolutely NO documentation exists that explains what the abstract methods should do, however I think I've implemented them correctly to serve outputcache via the ASP.Net Cache[] object. 

3. I've registered the provider in the web.config as outlined above, and I can see the site is invoking the "GetItemCount()" and  "Remove()" methods - so I know it is properly registered as a provider. 

MILLION DOLLAR QUESTION:  What settings must be set in order for me to see the site actually attempt to fetch/set cached content via the GetOutput() and SetOutput() methods.   DNN is taking all the steps necessary to invalidate cache, but it seems to NEVER be trying to save to or serve from the cache. 

Please advise. 
Thanks
 
New Post
12/10/2011 10:32 PM
 
Have you made any progress on creating/implementing the output caching provider?
 
New Post
4/12/2012 12:45 PM
 
I am also really interested in this. Has anybody implement an output caching provider... even if it's just for the anonymous page requests?
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Performance and...Performance and...Output Cache ProviderOutput Cache Provider


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out