Caching Application Pages And Data MCQs

Caching Application Pages And Data MCQs

These Caching Application Pages And Data multiple-choice questions and their answers will help you strengthen your grip on the subject of Caching Application Pages And Data. You can prepare for an upcoming exam or job interview with these 10 Caching Application Pages And Data MCQs.
So scroll down and start answering.

1: You need to programmatically configure page output caching. Which object would you use?

A.   Application

B.   Request

C.   Response

D.   Server

2: How many types of Cache Dependencies are available in ASP.NET?

A.   Time-based dependencies

B.   All

C.   Key-based dependencies

D.   File based dependencies

3:

You want to enable Page Output Caching in ASP.NET. What code you will write in ASPX page.

A.  

 None

B.  

 <%@ OutputCache VaryByParam="none" %>


C.  

 <%@ OutputCache Duration="30" %>


D.  

 <%@ OutputCache Duration="30" VaryByParam="none" %>


4:

What code you will write for using the cache object?

A.  

 // Storing the value.

Cache["name"]="CareerRide";


// Retrieving the value on any webpage within the application.


if (Cache["name"] != null)

Label1.Text= Cache["name"].ToString();


B.  

 // Storing the value.

Cache["name"]="CareerRide";


// Retrieving the value on any webpage within the application.


if (Cache["name"] != null)

Label1.Text= Cache["name"].Text;


C.  

// Storing the value.

Cache="CareerRide";


// Retrieving the value on any webpage within the application.


if (Cache != null)

Label1.Text= Cache.getStringValue;


D.  

 None

5:

According to the given below statements, choose the correct option.

Statement 1: Application caching is the process of storing data (and not pages) in a cache object.

Statement 2: Page output caching stores a rendered page, portion of a page, or version of a page in memory.

Statement 3: Caching reduces the time required to render cached page in future requests


A.  

All statements are correct

B.  

Only statement 3 is correct

C.  

 Statement 2 and 3 are correct

D.  

 Only statement 1 is correct


6:

If you want to cache the page according to the browser, then what will you do?

A.  

<%@ OutputCache Duration=”500” VaryByParam=”none” VaryByHeader=”browser” %>


B.  

 None

C.  

Write the given below code in aspx page.

<%@ OutputCache Duration=”500” VaryByParam=”none” VaryByCustom=”browser” %>


D.  

 Write the given below code in aspx page.

<%@ OutputCache Duration=”500” VaryByParam=” browser” VaryByCustom=”none” %>


7:

How will you specifying the Cache Location?

A.  

You can use the Location attribute of the <%@ OutputCache %> directive to specify where a page is cached

B.  

You can use the Location attribute in QueryString to specify where a page is cached

C.  

You can use browser settings to specify where a page is cached

D.  

None

8: How many types of caching ASP.NET supports?

A.   DataSource Caching

B.   Data Caching

C.   All

D.   Page Output Caching

E.   Partial Page Caching

9: What is the use of VaryByParam attribute in OutputCache directive?

A.   The VaryByParam attribute determines which web page is cached in database

B.   None

C.   You can neglect VaryByParam attribute while using Page output caching

D.   The VaryByParam attribute determines which versions of the page output are actually cached

10: The type of parameter supported by OutputCache is/are?

A.   VaryByControl

B.   VaryByParam

C.   VaryByHeader

D.   All

11: By default, when you use Page Output Caching, at what location page is cached?

A.   Web server, any proxy servers, and browser

B.   All

C.   Only on Client

D.   Only on web server

12: What types of data can you store in the Cache collection?

A.   You can store any type of data in the Cache collection

B.   Only DataSet Object

C.   All

D.   Only String Type of Data