OutputCache not working with Remote Data Binding

5 posts, 0 answers
  1. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 29 Dec 2014 Link to this post

    Hi, I'm having issues getting OutputCache to work with the remoteDatasource dropdown demo.  Whenever I run through Fiddler, I get this message "HTTP/1.1 Vary Header is present: *
    *: The server MUST be contacted to verify the freshness of this resource."

    I can put the outputcache on actions not called through the kendo datasource and they are cached as exptected.  Any ideas?

    http://demos.telerik.com/aspnet-mvc/dropdownlist/remotedatasource
    @(Html.Kendo().DropDownListFor(m => m.PasswordExpireOptionSelectedID)
        .DataTextField("Text")
        .DataValueField("Value")
        .DataSource(source =>
        {
            source.Read(read =>
            {
                read.Action(ListController.ActionGetPasswordExpireOptions, ListController.ControllerName);
            });
        })
    )
    // Action snippet
    private const int CacheDurationDefault = 86400;

    public JsonResult GetPasswordExpireOptions()
    {
          // some code here....
         return Json(returnValue, JsonRequestBehavior.AllowGet);
    }

  2. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 29 Dec 2014 in reply to Bob Link to this post

    Doh, i didn't paste my action snippet with the outputcache attribute.  Corrected version:

    [OutputCache(Duration = CacheDurationDefault)]
    public JsonResult GetPasswordExpireOptions()
    {
        // some code here...
        return Json(returnValue, JsonRequestBehavior.AllowGet);
    }
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 31 Dec 2014 Link to this post

    Hello,

    We are not sure what the exact problem is. Could you please answer the following questions?


    1. Do you see an Ajax request made to the action url in your browser developer tools?
    2. You say you can use actions cached in a similar way outside of Kendo UI. Can you show the code that uses those actions successfully?

    Answering those questions or providing a runnable sample code would allow us to assist you further.

    Regards,
    Atanas Korchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 31 Dec 2014 in reply to Atanas Korchev Link to this post

    Hi, I am actually no longer looking into this as my team is moving towards a different caching strategy.  Please feel free to delete this post entirely to avoid confusing others.  If we revisit this, I will start a new thread with more details. Thanks!
  6. Bob
    Bob avatar
    123 posts
    Member since:
    Sep 2012

    Posted 31 Dec 2014 in reply to Atanas Korchev Link to this post

    Hi, thanks for replying, but my team has decided to postpone implementing a caching strategy for now.  If we revisit, I will start a new thread with more details.  Feel free to delete this thread entirely to avoid confusing others.
Back to Top
UI for ASP.NET MVC is VS 2017 Ready