98-363 · Question #195
You create a webpage that displays recipes. You develop code that optimizes how the webpage is rendered for different web browsers. You need to ensure that the web server caches a version of the…
The correct answer is A. VaryByParam. You can vary caching of user-control output in two ways: Specify the user control name along with either a query string or a form POST parameter. You can do this declaratively using the VaryByParam attribute of the @ OutputCache directive. Alternatively, you can do it…
Question
You create a webpage that displays recipes. You develop code that optimizes how the webpage is rendered for different web browsers. You need to ensure that the web server caches a version of the page for the major version of each different web browser type that requests the webpage. Which attribute of the page OutputCache directive should you use?
Options
- AVaryByParam
- BVaryByHeader
- CVaryByCustom
- DVaryByControl
How the community answered
(41 responses)- A83% (34)
- B10% (4)
- C2% (1)
- D5% (2)
Explanation
You can vary caching of user-control output in two ways: * Specify the user control name along with either a query string or a form POST parameter. You can do this declaratively using the VaryByParam attribute of the @ OutputCache directive. Alternatively, you can do it programmatically by setting VaryByParams property in the PartialCachingAttribute in the user control's code. * Specify the ID property of an ASP.NET server control contained in the user control. You can do this declaratively using the VaryByControl attribute. Alternatively, you can do it programmatically by setting the VaryByControls property in the PartialCachingAttribute.
Topics
Community Discussion
No community discussion yet for this question.