Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8279389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:19:20+00:00 2026-06-08T09:19:20+00:00

Is is possible to cache an MVC partial view being returned from an ajax

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T09:19:23+00:00Added an answer on June 8, 2026 at 9:19 am

    This would cache the view on the server – limiting server load –

    Change your action to:

    public class Home : Controller
    {
        // You can change this duration to whatever you want (in seconds)
        [OutputCache(Duration = 6000)] 
        public ActionResult SignIn()
        {
            return View("SignIn");
        }
    }
    

    Your AJAX request remains the same:

    $.get('/Home/SignIn', function (data) { $('.content').html(data); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to clear the output cache of one asp.net web application from
Is it possible to clear one action's cache from another action? Let's say my
Does anybody know if it possible to cache the image from the database? I
Is it possible to cache the response of a http handler on the server
Possible Duplicate: How to invalidate the file system cache? In order to be able
Is it possible to query Google's cache with a specific date range. for instance,
Possible Duplicate: How can I see what's in my HttpContext.Cache Something funny is happening
I would like to cache my website with memcache as much as possible. There
im trying to orient my code to use the cache as efficiently as possible
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.