Take the 2-minute tour ×

I have a JQM page that dynamically insert content from a call to MVC controller.

I tested this from my phone and then made some changes to the code, uploaded it to the server and ty to hit the page again from my phone and I see the old content. How can I clear the current cache and then prevent the future calls to the MVC from being cache.

this is how I load the content the div

        url: "/Controller/Method",
        data: null,
        type: "POST",
        success: function (data) {


        error: function (data) {
            alert("Error in RenderQuestionForm");
share|improve this question

1 Answer 1

You can prevent a controller action from caching a returned view by using an annotation, for example:

// GET: /Index/
    [OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
    public ActionResult Index()
        return View(_repository.ListAll());

It's also possible that the data being returned to a controller action is being cached by the data provider. I've run into this with LINQ, where a service I was accessing was caching LINQ queries by default. in that case I needed to clear the cache prior to each new query.

share|improve this answer

Your Answer


