Partial view caching in asp.net MVC

I have the following situation in webapp:

The Employees table contains the Department and Function columns . Both are dropdownlists.

The options for the Function drop-down list depend on the selected department. (therefore, each department has its own list of functions)

When changing the department, I make an ajax call for the controller action with the "DepartmentId" parameter. Theres [outputcache] attribute on controlaction, so the functions that it returns are cached for each department identifier.

My problem is the initial loading of the page. Is it possible to call the controller in the view and use caching?

Is anyone 30 views and no replies. Any comments on my question? Too obvious? too complicated? too weird? something for google (altho i did not find a solution there)?

+5
source share
3 answers

Phil Haack wrote a short blog post on a similar topic called Donut Hole Caching . This serves as a good starting point.

+4
source

, , . , , . , . , , . , , .

, ajax, "" .

, .

+4

, , , ajax? , , (, ). , , .

  • - HttpContext.Cache (, , OutputCache )
  • / , json , ajax.
0

All Articles