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
What does WSDL stand for?  WSDL stands for Web Services Description Language.  It is an XML representation of the web service interface. There are two parts of the operation

The SQL cache dependencies is a new characteristic in ASP.NET 2.0 which can automatically invalidate a cached data object (like a Dataset) when the related data is modified in the

Explain different types of XML Application Programming Interface (API). The following are two main parts of XML parsers: Tree-based API - Compiles an XML document into a tre

What is the difference between DELETE TABLE and TRUNCATE TABLE commands? Following are differences between delete & truncate commands:- 1)The DELETE TABLE syntax logs the de

Accepting a List of 5 Items - C# Program Hello, I've been trying so many codes for this but those codes didn't work well. Please write the code for Accepting a List of 5 Items

What is a node? A network can have of two or more computers directly linked by some physical medium such as coaxial cable or optical fiber. Such a physical medium is known as L

Program of Declaring a function - C# Program Program of Declaring a function, I am looking for a program in C#. It would be great if anyone help me learn function in C# langua

What is SIX sigma? The Sigma means the deviation in Greek language. The Deviation means how much variations exist in a set of data. For illustrate  let's say in a software main

Perform Arithmetic Operations - c# Program Hello, i didn't find the correct way of using arithmetic operations in c#. I am beginner for this language. Please suggest me some e

If client side validation is enabled in your Web page, does that mean server side code is not run Whenever the client side validation is enabled server emit's JavaScript code f