exam questions

Exam 70-487 All Questions

View all questions & answers for the 70-487 exam

Exam 70-487 topic 1 question 41 discussion

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

DRAG DROP -
You are developing a web application by using Microsoft ASP.NET MVC.
The web application will shoe a list of cars and their associated prices. The list can be filtered by car model by using a drop-down list. Access to the web application will be anonymous.
The car model list is stored as an .xml file on the application server. The car prices list is stored on a SQL Server server.
You need to recommend a caching strategy for each scenario:
✑ If a user selects a car model from the drop-down list, and then closes the browser, the same model must be selected automatically when the user reopens the web application from the same browser.
✑ If the car model list is updated, the drop-down list must be refreshed upon the next page reload.
If the car prices list is updated, the prices list must be refreshed upon the next page reload.

What should you recommend? To answer, drag the appropriate caching strategies to the correct scenarios. Each caching strategy may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: outputCache -
outputCache declaratively controls the output caching policies of an ASP.NET page or a user control contained in a page.

Box 2: CacheDependency -
CacheDependency establishes a dependency relationship between an item stored in an ASP.NET application's Cache object and a file, cache key, an array of either, or another CacheDependency object. The CacheDependency class monitors the dependency relationships so that when any of them changes, the cached item will be automatically removed.

Box 3: SqlCacheDependency -
SQL cache dependency enables you to cache pages that are dependent on data from SQL Server tables. You can configure SQL Server and ASP.NET tocache page requests, reducing server workload, until the data on which the page depends has been updated in SQL Server. SQL cache dependency is useful for data such as product catalogs or customer registration information that remains comparatively static. outputCache CacheDependency
References:
https://msdn.microsoft.com/en-us/library/system.web.caching.cachedependency(v=vs.110).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
tiger25
Highly Voted 5 years, 4 months ago
First answer is cookie.
upvoted 18 times
MalaSvinjica
5 years ago
Cookie is not a .net caching strategy! Please refer to: https://www.codemag.com/Article/0205071
upvoted 3 times
mr_
4 years, 11 months ago
I don't see anything about '.NET caching strategy' in the requirements. What I see instead is just 'caching strategy' which for cookie option sounds perfectly fine.
upvoted 3 times
...
...
Dev666
4 years, 9 months ago
cookie
upvoted 1 times
...
...
Dreamchaser1980
Most Recent 4 years, 9 months ago
I think the answer should be using cookies in order to populate the dropdownlist. Because access to the web application will be anonymous(does not retain state information) , so the only way to store the dropdownlist value is to use client side caching which can be ApplicationCache or Cookie. It is not OutputCache because it is used to cache the content returned by a controller action method, so that, the same content does not need to be generated each and every time the same controller action is invoked, which means that all users will get the last cached dropdownlist value, which does not have to be their last selected value.
upvoted 2 times
Dreamchaser1980
4 years, 9 months ago
The answer is OutputCache. After some research, I found that OutputCache can also be used to cache information client side, for example [OutputCache(Duration = 10, VaryByParam = “none” , Location = OutputCacheLocation.Client )]. OutputCacheLocation.Client means, cache is stored on client side. https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.outputcachelocation?view=netframework-4.8
upvoted 4 times
...
zimzimzimma
4 years, 9 months ago
It looks like window.applicationCache is deprecated. https://github.com/pylonide/pylon/issues/57 https://developer.mozilla.org/en-US/docs/Web/API/Window/applicationCache
upvoted 1 times
...
zimzimzimma
4 years, 7 months ago
But does that also work after you close the browser and open it again? It has to be persistent cache.
upvoted 1 times
...
...
Moca3
5 years, 3 months ago
I think the answer is OK
upvoted 2 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 ...