exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 97 discussion

Actual exam question from Microsoft's 70-486
Question #: 97
Topic #: 1
[All 70-486 Questions]

HOTSPOT -
You are developing an ASP.NET MVC application to display product information. The application has two views. The first view displays a list of product names.
When you select a product name, the second view shows detailed information for the product that is selected. The product detail view receives a query string value that contains as identifier for the product that is selected.
The product controller for the application has the following requirements:
✑ The product list and product details must use output caching.
✑ The list of products must be cached daily.
✑ The product details view must cache data for one hour, based on the product that is selected.
You need to implement the product controller.
How should you complete the relevant code? To answer, select the appropriate code from each list in the answer area.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: [OutputCache(Duration = 86400, VaryByParam ="none")]
The list of products must be cached daily. One day is 86400 seconds (60*60*24).
Note: The Duration parameter is the time, in seconds, that the page oruser control is cached. Setting this attribute on a page or user control establishes an expiration policy for HTTP responses from the object and will automatically cache the page or user control output.
Box 2: [OutputCache(Duration = 3600, VaryByParam ="id")]
The product details view must cache data for one hour, based on the product that is selected. One hour is 3600 seconds (60* 60).
References:
https://msdn.microsoft.com/en-us/library/hdxfb6cy(v=vs.100).aspx

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
hungry_ape9000
Highly Voted 5 years, 2 months ago
FINAL ANSWER: [OutputCache(Duration = 86400, VaryByParam = "none")] [OutputCache(Duration = 3600, VaryByParam = "id")]
upvoted 6 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...