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
Explain the difference between an ADO.NET Dataset and an ADO Recordset. The two main basic differences between recordset and dataset are as shown below :- 1) With the datase

Project Description:                                   Urgently require an expert with good knowledge of writing experience and UML diagrams. This project requires technologi

#queWrite a XML with database with book details (BOOK ID, Title, Author, subject, published Year, language, vendor, price)stion..

Experienced Microsoft .NET web developer I have a various projects for which I need a web developer for. The developer will be the sole product owner hence should be dependab

Explain Component diagrams Package: - The Package logically make group of element of a UML model. Component: - It is the actual physical module or implementation of

Program for Solution of Linear Equations - C# Program Hello, I've been trying so many codes for this but those codes didn't work well. Please write a Program for solving Linea

What is the use of connection object? The connection objects are used to connect a data to the Command object. 1)An OleDbConnection object is used with the  OLE-DB provider

What is the difference between Shadowing and Overriding? The main basic difference between shadowing and overriding are as follows:- 1) The Overriding redefines only the imp

I need a Web Application UI Modernization - Preliminary Technology Assessment We are seeking to overhaul a 10-year old enterprise application, CRM-related as well as web-based t

What is boxing in .net