Is is possible to cache an MVC partial view being returned from an ajax get request?
Here’s my scenario. I’m calling a url which points to a controller method that returns a partial view:
Controller method:
public ActionResult SignIn()
{
return View("SignIn");
}
Ajax request to get the view:
$.get('/Home/SignIn', function (data) { $('.content').html(data); });
Is it possible to cache my “SignIn” view so that each time the user clicks it, it doesn’t have to go back to the server to fetch the view from the controller again?
This would cache the view on the server – limiting server load –
Change your action to:
Your AJAX request remains the same: