what is SQL cache Invalidation?

Answer Posted / jitender.chauhan

SQL cache invalidation enables you to make the cache entry
dependent on the database, so the cache entry will only be
cleared when data in the database is changed.

Polling-based Invalidation
This mechanism uses polling to check if a table has been
updated since the page was cached.

SQL Server 2005 Notification-based Cache Invalidation
This mechanism uses the query change notification mechanism
of Sql Server 2005 to detect changes to the results of
queries. Unlike polling based invalidation for Sql Server
7.0 and 2000, notification based invalidation requires much
less setup.

1. Unlike polling based validation, no <sqlCacheDependency>
needs to be registered in your application's configuration.
Furthermore, no special configuration using the
aspnet_regsql.exe tool is needed.

2. A notification based dependency is configured on the
OutputCache directive using the string CommandNotification.
This value indicates to ASP.NET that a notification based
dependency should be created for the page or datasource
control.

3. System.Data.SqlClient.SqlDependency.Start() method must
be called somewhere in the application before the first SQL
query is executed. This method could be placed in
Application_Start() event in global.asax file.

Whenever a command is issued to Sql Server 2005, ASP.NET
and ADO.NET will automatically create a cache dependency
that listens to change notifications sent from the SQL
Server. As data is changed in Sql Server, these
notifications will cause the cached queries to be
invalidated on the web server. The next time a page or
datasource control associated with the dependency is
requested, the page or datasource control will be executed
again as opposed to serving cached information.

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the procedure to handle the process request using mhpm events fired? : asp.net mvc

758


How to create discussion forum in asp.net mvc? : Asp.Net MVC

745


What is role-based security in asp.net?

716


Explain what is postback in asp. Net?

768


How do you secure your connection string information?

706


Why does my asp.net file have multiple tag with runat=server?

764


Can a master page have more than one contentplaceholder?

721


How to create multi language website in asp.net mvc? : Asp.Net MVC

677


What are sql joins?

754


What is work flow gen? how can it will work with .Net?

2754


What is variable and constant in .net programming language?

588


Define the term Web Garden?

715


What is asp according to you?

731


Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?

771


How many types of cookies are available in asp?

784