Caching pages and data - ASP.NET (MCQ) questions and answers

1)   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.

- Published on 28 Jul 15

a. Only statement 1 is correct.
b. Statement 2 and 3 are correct.
c. Only statement 3 is correct.
d. All statements are correct.
Answer  Explanation 

ANSWER: All statements are correct.

Explanation:
No explanation is available for this question!


2)   How many types of parameter supported by OutputCache?
- Published on 27 Jul 15

a. VaryByParam
b. VaryByControl
c. VaryByHeader
d. VaryByCustom
e. All of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
No explanation is available for this question!


3)   What types of data can you store in the Cache collection?
- Published on 27 Jul 15

a. Only String Type of Data
b. You can store any type of data in the Cache collection.
c. Only DataSet Object
d. All of the above.
Answer  Explanation 

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

Explanation:
No explanation is available for this question!


4)   What code you will write for using the cache object?
- Published on 27 Jul 15

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="CareerRide";
// Retrieving the value on any webpage within the application.
if (Cache != null)
Label1.Text= Cache.getStringValue;
c.
// Storing the value.
Cache["name"]="CareerRide";
// Retrieving the value on any webpage within the application.
if (Cache["name"] != null)
Label1.Text= Cache["name"].Text;
d. None of the above.
Answer  Explanation 

ANSWER:
// Storing the value.
Cache["name"]="CareerRide";
// Retrieving the value on any webpage within the application.
if (Cache["name"] != null)
Label1.Text= Cache["name"].ToString();

Explanation:
No explanation is available for this question!


5)   By default, when you use Page Output Caching, at what location page is cached?
- Published on 27 Jul 15

a. Only on web server
b. Only on Client
c. Web server, any proxy servers, and browser
d. All of the above.
Answer  Explanation 

ANSWER: Web server, any proxy servers, and browser

Explanation:
No explanation is available for this question!


6)   How many types of Cache Dependencies are available in ASP.NET?
- Published on 27 Jul 15

a. File based dependencies
b. Key-based dependencies
c. Time-based dependencies
d. All of the above
Answer  Explanation 

ANSWER: All of the above

Explanation:
No explanation is available for this question!


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

- Published on 27 Jul 15

a. <%@ OutputCache Duration="30" VaryByParam="none" %>
b. <%@ OutputCache VaryByParam="none" %>
c. <%@ OutputCache Duration="30" %>
d. None of the above.
Answer  Explanation 

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

Explanation:
No explanation is available for this question!


8)   You need to programmatically configure page output caching. Which object would you use?
- Published on 27 Jul 15

a. Request
b. Response
c. Application
d. Server
Answer  Explanation 

ANSWER: Response

Explanation:
No explanation is available for this question!


9)   What is the use of VaryByParam attribute in OutputCache directive?
- Published on 27 Jul 15

a. You can neglect VaryByParam attribute while using Page output caching.
b. The VaryByParam attribute determines which versions of the page output are actually cached.
c. The VaryByParam attribute determines which web page is cached in database.
d. None of the above.
Answer  Explanation 

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

Explanation:
No explanation is available for this question!


10)   How many types of caching ASP.NET supports?
- Published on 24 Jul 15

a. Page Output Caching
b. Partial Page Caching
c. Data Caching
d. DataSource Caching
e. All of the above.
Answer  Explanation 

ANSWER: All of the above.

Explanation:
No explanation is available for this question!


1 2