|
Question 7
What is scavenging
Caching is the process of storing essential information on the server memory for fast retrieval. but sometimes when the server is very low on memory it need to remove some items from the cache. this is called scavenging. cache items with low priority will be removed first. we can set the priority of the caching object using cacheitempriority property.
|
Question 8
What are different types of caching using cache object of asp.net
.net provides three different types of caching mechanisms
1) page level caching – in page level caching the entire page output will be cached. only on the first call the page output will be generated. for subsequent request it will be retrieved from the cache. page level caching is best suitable for static pages
2) page fragment caching or partial-page output caching – in this caching only a portion of the page will be cached. this portion should be a user control with outputcache directive mentioned on it.
3) application caching or data caching – in this caching data will be cached. a best example for data caching will be list of counties. instead of retrieving country data from the database every time we can use data caching approach.
|
Question 9
How can you cache different version of same page using asp.net
cache object
Outputcache directive is used to achieve this functionality. we can specify the cache dependencies using parameters like varybycontrol, varybycustom , varybyheader, varybyparam,varybycontentencoding
|
Question 10
How will implement page fragment caching
Outputcache directive is used to achieve this functionality. we can specify the cache dependencies using parameters like varybycontrol, varybycustom , varybyheader, varybyparam,varybycontentencoding
|
Question 11
Which are the various modes of storing asp.net session
Various modes to store objects in asp.net are described below
1) in proc – this is the default mode to store a session object. in this mode session objects will be stored on the same server memory where the site is hosted. this mode is not suitable for web farms where the web site is hosted in multiple servers to perform load balancing. in inproc mode session objects will be lost on iis restart. in proc mode is faster compared to other modes
2) stateserver – in this mode session objects will be stored on a different process/server. this mode is suitable for web farm since the session objects can be shared between webservers.
3) sql server - in this mode session objects will be stored on a sql server database. this mode is suitable for web farms.
|
Question 12
Difference between asp session and asp.net session
Classic asp sessions will not work when the browser doesn’t support cookies. also classic asp sessions are stored on the same webserver which is not suitable for a web farm environment. asp.net session cab be stored on a different server
|