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
Project Description: This project uses Microsoft Visual Studio 2010/2012, Internet Information Services (IIS) Manager and Microsoft SQL Server Management Studio. It is a Mobi

I have the working code I''m using to print the SQL table right now. I just need code to print in reverse order.

What are the different elements in Functions points? 1) Internal Logical Files (ILF): Following are some points to be noted for ILF:- The ILF are logically related d

Sorting 2 Arrays & Merging into 1 - C# Program Hello, i didn't find the correct way to implement Array in my project. I am beginner for this language.  Please suggest me some

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Why does an organization need to manage the workloads? The workload can be explained as an independent service or a set of code that can be implemented. It can be everything f

What are satellite assemblies? We use resource files to store data according to the localized languages. But when you actually go for the deployment you will not like to also i

Write a program of console statements - C# Program I am unable to make out the use of console statements in C# language. Can anyone suggest me any example for this.

Explain the concept of constructor? Constructor is a special method of a class, which is called automatically when the instance of a class is formed. It is created with the sam

What are the ways to implement locking in ADO.NET? There are many ways to implement locking using ADO.NET which are shown below:- 1)Whenever we call "Update" method of DataA