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 are the types of dependencies in cache? Whenever you add an item to the cache, the dependency relationships is define that can force that item to be removed from the cache

What is difference between abstract classes and interfaces? The difference b/w abstract and interfaces are s follows:- 1.     The Abstract classes can have concrete methods

Describe the rules and regulations that must be followed whereas creating a well-formed XML document. The following are the rules and regulations that are essential to follow w

Project Description: i will testing some software which you need and i promise to do my job is the best way, and as fast as possible. Skills required: .NET, MySQL, C# P

Install Modules to enhance Site Proformance Project Description: As shown, I need the subsequent modules installed, to improve loading time for my graphics and images, improv

What is nested Classes? You can access an array using the INDEX value of that array, but how many times you know the real value of the index. The Hashtable provides a way of ac

Unity 4 iOS Pro Developer to prepare link.xml Project Description: I'm seeking an iOS developer with a Unity 4 iOS Pro license to prepare a link.xml file that will let my pro

Project Description: I am preparing a speech recognition program and need a quick code to get it done I am seeking for someone to create a Gmail API that can get subject, and co

Define the ToolTip control. How can you associate it with other controls? The ToolTip control produces a small pop-up window with explanatory text for an element it is displaye

What is the difference between delegate and events? Actually events use delegates in the bottom. But they also add an extra layer on the delegates, hence forming the publisher