Post cache substitution, DOT NET Programming

What is Post Cache substitution?

The Post cache substitution is used when we want to cache the complete page but also require some of the dynamic region inside that cached page. Some examples such as RandomPhotos, QuoteoftheDay, and AdRotator etc.  Where we can implement the Post Cache Substitution.

Post-cache substitution can be achieved by 2 means:

1) Call the new Response.WriteSubstitution process, passing it a reference to the desired substitution method callback.

2) Add a control to the page from  the desired location, and fixed  its methodName attribute to the name of the callback method.

816_post cache substitution.png

Figure: - "Writesubstitution" in action

We have "GetDateToString()" a static function  . We pass the response substitution callback to the "WriteSubstitution" process. So now when ASP.NET page framework retrieves the cached page, it automatically triggers your callback process to get the dynamic content. Now it inserts your content into the cached HTML of the page. Even if your page hasn't been cached yet (for example, it's being rendered for the first time), ASP.NET still calls your callback into the same way to get the dynamic content. So you create a process which generates some dynamic content, and by doing so you assure  that your process is always called, and it's content is never cached.

The example above was by using "WriteSubstitution" now lets try to see how we can do by using "" control. You can get the "" control from the editor toolbox.

75_post cache substitution1.png

Figure: - Substitution Control

1735_post cache substitution2.png

Figure: - Substitution in Action

Posted Date: 9/21/2012 9:09:11 AM | Location : United States







Related Discussions:- Post cache substitution, Assignment Help, Ask Question on Post cache substitution, Get Answer, Expert's Help, Post cache substitution Discussions

Write discussion on Post cache substitution
Your posts are moderated
Related Questions
ASP.NET 2.0 application port to ASP.NET MVC Project Description: Legacy ASP.NET application for managing tasks for a private client needs a complete re-write. The applicat

What is ReaderWriter Locks? You may want to lock the resource only whenever data is being written and permit multiple clients to parallel read data when data is not being updat

Project Description: I am seeking some automated trading software for the given strategy, I am using Omnesys Nest trader Step 1: Buy one share at current market price (ex:

HOW TO DESIEN THE CALENDER IN ASP . NET

Avoid deadlock in threading The best  and careful planning may avoid deadlocks.There are so many ways Microsoft has provided by which you can decrease deadlocks for example Int

Inventory billing and Management application in .net Project Description: Digital Inventory management Main Features         Multi user User friendly windows based s

We need a .NET Synchronisation of BugNet -> Paymo -> Insightly We need a small .net utility that is able to synchronise projects as well as tasks between three applications 1

Wowza expert required Project Description: Seeking wowza expert to teach our webmaster. To provide: How configure wowza to live transcoder. How allow add live transc

How do we access view state value of the page in the next page? The View state is page specific; it contains information about controls embedded at the particular page. ASP.NET

Project Description: customise samba pos. Just remove samba pos logo and rebrand it. The title in the frame needs to be changed as well as the splash screen at the beginning.