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:
Explanation:
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).
https://msdn.microsoft.com/en-us/library/hdxfb6cy(v=vs.100).aspx
Admin, please fix “hot area” broken image.
Correct