Which two actions should you perform?

You are implementing an ASP.NET page that hosts a user control named CachedControl. You need to
ensure that the content of the user control is cached for 10 seconds and that it is regenerated when
fetched after the 10 seconds elapse. Which two actions should you perform? (Each correct answer
presents part of the solution. Choose two.)

You are implementing an ASP.NET page that hosts a user control named CachedControl. You need to
ensure that the content of the user control is cached for 10 seconds and that it is regenerated when
fetched after the 10 seconds elapse. Which two actions should you perform? (Each correct answer
presents part of the solution. Choose two.)

A.
Modify the hosting page’s caching directive as follows.
<%@ OutputCache Duration=”10″ VaryByParam=”None” %>

B.
Add the following meta tag to the Head section of the hosting page.
<meta http-equiv=”refresh” content=”10″>

C.
Add the following caching directive to the hosted control.
<%@ OutputCache Duration=”10″ VaryByParam=”None” %>

D.
Add the following caching directive to the hosted control.
<%@ OutputCache Duration=”10″ VaryByControl=”None” %>

Explanation:
CHAPTER 2 Using Master Pages, Themes, and Caching
Lesson 3: Caching
Page Output Caching (page 83)
HTTP-EQUIV Attribute | httpEquiv Property
(http://msdn.microsoft.com/en-us/library/ms533876(v=vs.85).aspx)
meta http-equiv gets or sets information used to bind the value of a content attribute of a meta
element to an HTTP response header.
Examples:
This example causes the browser to reload the document every two seconds.
<meta http-equiv=”refresh” content=”2″>
This example sets the character set for the document.
<meta http-equiv=”Content-Type”
content=”text/html; charset=utf-8″>
This example disables theme support for the document.
<meta http-equiv=”msthemecompatible” content=”no”>
This example tells Internet Explorer to display a webpage in IE9 mode, if possible.
<meta http-equiv=”X-UA-Compatible” content=”IE=9″>



Leave a Reply 0

Your email address will not be published. Required fields are marked *