26.02.2015 Views

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5. Caching Concepts<br />

(B) What is application object ?<br />

Application object can used in situation where we want data to be shared across users<br />

globally.<br />

(I)What’s the difference between Cache object and application object ?<br />

The main difference between the Cache and Application objects is that the Cache object<br />

provides cache-specific features, such as dependencies and expiration policies.<br />

(I)How can get access to cache object ?<br />

The Cache object is defined in the System.Web.Caching namespace. You can get a reference<br />

to the Cache object by using the Cache property of the HttpContext class in the<br />

System.Web namespace or by using the Cache property of the Page object.<br />

(A)What are dependencies in cache and types of dependencies ?<br />

When you add an item to the cache, you can define dependency relationships that can<br />

force that item to be removed from the cache under specific activities of<br />

dependencies.Example if the cache object is dependent on file and when the file data<br />

changes you want the cache object to be update.Following are the supported dependency<br />

:-<br />

√<br />

File dependency :- Allows you to invalidate a specific cache item when a disk<br />

based file or files change.<br />

√ Time-based expiration :- Allows you to invalidate a specific cache item<br />

depending on predefined time.<br />

√<br />

Key dependency :-Allows you to invalidate a specific cache item depending<br />

when another cached item changes.<br />

88

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!