070-486J Free Dumps Study Materials
Question 5: あなたはスポーツファンにリアルタイムのゲーム結果を提供するASP.NET
MVCアプリケーションを開発しています。
アプリケーションには次のコードが含まれています。
行番号は参照用にのみ記載されています。
ゲーム結果のソースデータは30秒ごとに更新されます。
テスターは、アプリケーションに関する次の問題を報告します。
パフォーマンスの問題を修正する必要があります。
どちらのコードを変更する必要がありますか?
それぞれの正解は、解の一部を表しています。
A. Replace the code at line 07 with the following code segment:[OutputCache(Duration =
3 0, VaryByParam = "none", Location = OutputCacheLocation.Client, NoStore = true)]
B. Replace the code at line 12 with the following code segment:[OutputCache(Duration =
3 0, VaryByParam = "none", Location = OutputCacheLocation.Server, NoStore = true)]
C. Replace the code at line 07 with the following code segment:[OutputCache(Duration =
3 600, VaryByParam = "none", Location = OutputCacheLocation.Server, NoStore = false)]
D. Replace the code at line 12 with the following code segment:[OutputCache(Duration =
3 600, VaryByParam = "none", Location = OutputCacheLocation.Client, NoStore = true)]
Correct Answer: A,B
Explanation:
B: They report delays in seeing the latest game results. This is the output of the GetResults()
function. We decrease the Duration in the cache for this function from 3600 to 30. This is one
line 12.
A: They report seeing other user's name when they sign in to the application. This is the
output of the GetUserInfo() function. We should change the OutputCacheLocation of the
caching of this function from Server to Client. This is on line 7.
Note: The OutputCacheLocation.Client option indicates that the content should be cached at
the requesting client. Any requests for the same resource made from the same client within
the expiry period, will be served out the client's cache, without a network request being made
to the server.
The OutputCacheLocation.Server option indicates that the content will be cached at the
origin server. This content will be served for subsequent requests made by the initial client
and any other client requesting the same resource within the expiry period.
References: https://growlycode.wordpress.com/2014/01/10/mvc4-outputcache-location-
basics/