.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> ASP.Net >> Post New Question Subscribe to Interview Questions

How can we get the path of the internet cache?

Posted By :nishithraj     Posted Date :March 31, 2010    Points :10   Category :ASP.Net 
Using the following code


You can also find related Interview Question to How can we get the path of the internet cache?  below: 

How can I see what assemblies are installed in the global assembly cache?

The .NET Framework ships with a Windows shell extension for viewing the assembly cache. Navigating to % windir%\assembly with the Windows Explorer activates the viewer. (More...)

where is global assembly cache location in system?

The .NET Framework ships with a Windows shell extension for viewing the assembly cache. Navigating to % windir%\assembly with the Windows Explorer activates the viewer. (More...)

What is SQL Cache Dependency in ASP.NET?

SQL cache dependencies is new technique in ASP.NET 2.0 onwards which can automatically invalidate a cached data object just like a Dataset. when the related data is modified in the database. So for instance if you have a dataset which is tied up to a database tables any changes in the database table will invalidate the cached data object which can be a dataset or a data source.

To enable this we need a syntax that is as follows in visual studio command prompt type the following command

aspnet_regsql -ed -E -d (More...)

What are Cache - Dependencies types?

When anyone add an item to cache, he/she can define the dependency relationships that can force that item to be removed from the cache under specific activities of dependencies.

For example: If the cache is dependent on file and when the file data changes you want the cache object to be updated.

Following are the difference dependencies:
(a) File Dependency :
Allows invalidating a specific cache item when a disk based file or files change.
object errorData;
//Load errorData from errors.xml

CacheDependency fileDependency =
new CacheDependency(Server.MapPath("errors.xml"));
Cache.Insert("ERROR_INFO", errorData, fileDependency);

(b) Time based expiration :
Allows to invalidate a specific cache item depending on predefined time.

//Absolute Expiration

Cache.Insert("EMP_NAME", "Shubhabrata", null,
DateTime.Now.AddDays(1), Cache.NoSlidingExpiration);

//Sliding Expiration

Cache.Insert("EMP_NAME", "Shubhabrata", null,
Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(60));

(c) Key dependency :
Allows to invalidate a specific cache item depending when another cache item changes.

string[] relatedKeys = new string[1];
relatedKeys[0] = "EMP_NUM";
CacheDependency keyDependency = new CacheDependency(null, relatedKeys);
Cache["EMP_NUM"] = 5435;
Cache.Insert("EMP_NAME", "Shubhabrata", keyDependency);
Cache.Insert("EMP_ADDR", "Bhubaneswar", keyDependency);
Cache.Insert("EMP_SAL", "5555USD", keyDependency); (More...)

What are virtual path providers?

Its the path providing facility to provide the virtual content to compiler. For example, a virtual path provider provides a means to supply content from locations other than the file system.

To attain the same following step(s) are required :
1. Create a VirtualPathProvider class, and implement all the required methods to handle files and folder requests.

2. Register the virtual path provider to let the ASP.NET hosting environment know where the content will be served from.

3. Create VirtualFile and VirtualDirectory objects to stream the content.

For more details, visit http://support.microsoft.com/kb/910441 (More...)

Can you place two .dll files with the same name in GAC (Global Assembly Cache)?

Yes, provided both have different versions.
GAC is a Folder that contains .dll that have strong name. So we can keep myproject.dll and myproject.dll two files into GAC with different version like and (More...)

What is the difference between Microsoft Office SharePoint Server 2007 for Internet sites and Microsoft Office SharePoint Server 2007?

Microsoft Office SharePoint Server 2007 for Internet sites and Microsoft Office SharePoint Server2007 have identical feature functionality. While the feature functionality is similar, the usage rights are different.If you are creating an Internet, or Extranet, facing website, it is recommended that you use Microsoft Office SharePoint Server 2007 for Internet sites which does not require the purchase client access licenses. Websites hosted using an "Internet sites" edition can only be used for Internet facing websites and all content, information, and applications must be accessible to non employees.Websites hosted using an "Internet sites" edition cannot be accessed by employees creating, sharing, or collaborating on content which is solely for internal use only, such as an Intranet Portal scenario. (More...)

Is the ASP.NET AJAX Control Toolkit(AjaxControlToolkit.dll) installed in the Global Assembly Cache?

No. You must copy the AjaxControlToolkit.dll assembly to the /Bin folder in your application. (More...)

How can you cache Multiple Versions of a Page?

Using output cache you can cache multiple versions of the page.

We can either use,.

- @ OutputCache directive at design time declaratively for Declarative Approach

- Response.Cacheclass at runtime for Programmatic Approach .

With @ OutputCache directive four parameters of VaryByParam , VaryByControl, VaryByHeader, VaryByCustom allows user to cache page depending on query string, control value, request's HTTP header, request's HTTP header respectively.

For an example:

To turn off caching,

Declarative Approach:
<%@ OutputCache Location="None" VaryByParam="None" %>

Programmatic Approach:

To cache the output for each HTTP request that arrives with a different ID:

Declarative Approach:
<%@ OutputCache duration="60" varybyparam=" ID" %>

Programmatic Approach:
Response.Cache.VaryByParams["ID"] = true; (More...)

Is it possible to notify application when item is removed from cache ?


You can use CacheItemRemovedCallback delegate defining signature for event handler to call when item is removed from cache.

For an example:

"CacheItem1", //insert cache item
new TimeSpan(0, 0, 15),
new CacheItemRemovedCallback(RemovalMethod)); //define method which needs to be called when item is removed from cache

The method will be like,
private static string RemovedAt = string.Empty;
public static void RemovalMethod(String key, object value, //method is declared static so that it can be available when cache item is deleted
CacheItemRemovedReason removedReason)

RemovedAt = "Cache Item Removed at: " + DateTime.Now.ToString(); //Shows the time when cache item was removed

} (More...)

What is difference between System.Web.Caching.Cache and System.Web.HttpContext.Current.Cache ?

System.Web.Caching.Cache : Class/type used for caching
System.Web.HttoContect.Current.Cache : The instance of cache class for current HTTP context from a web request (Gets cache object from current application domain) (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend