prevent ajax caching on .read()

11 posts, 1 answers
  1. David A.
    David A. avatar
    126 posts
    Member since:
    Aug 2008

    Posted 15 Aug 2012 Link to this post

    Hi,
    I am using the MVC helpers and ran into a problem with json data caching in ie.  I don't see a way to set caching = false with the fluent DropDownList helper.  Am I missing something with this?

    My workaround is to tag my json methods with the following (courtesy of Zack at http://www.kendoui.com/forums/framework/data-source/read-without-cache.aspx)

    [OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]

    David A
  2. Answer
    Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 20 Aug 2012 Link to this post

    Hello David,

     
    In general you cannot disable the cache through the fluent interface. Nevertheless it is sufficient to set the ServerFiltering to true in order to achieve your goal:

    .DataSource(source => {
                  source.Read(read =>
                  {
                      read.Action("GetCascadeProducts", "ComboBox")
                          .Data("filterProducts");
                  })
                  .ServerFiltering(true);
              })
    Check the CascadingDropDownList demo. Let me know if I am missing something.

    Regards,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Bubuy
    Bubuy avatar
    1 posts
    Member since:
    Sep 2012

    Posted 11 Sep 2012 Link to this post

    I am also running into the same problem.  I have cascading dropdownlist on kendo grid's popup editor.  I have tried both suggestions and it is still not working.  the caching problem happens when you switch from edit mode to create or vice-versa.
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 12 Sep 2012 Link to this post

    Hello Arnold,

    I answered the support ticket opened on the same subject. I will ask you to continue our conversation there in order to avoid any duplications. 

    Greetings,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. michel
    michel avatar
    11 posts
    Member since:
    Apr 2013

    Posted 27 May 2013 Link to this post

    Running into the same problem, but we don't want to change to ServerFiltering.
    Disable of cache on Controller level does not fix the problem.

    Any ideas to force the control to refresh it's items ?
  7. Justin
    Justin avatar
    1 posts
    Member since:
    Jan 2013

    Posted 29 May 2013 Link to this post

    You actually can prevent caching from the fluent interface. You just need to set the type to 'Post' for your read action.  ie -

    .DataSource(source =>
     {
               source.Read(read =>
                       {
                               read.Action("ActionMethod", "Controller").Type(HttpVerbs.Post);
                        });
    })
  8. michel
    michel avatar
    11 posts
    Member since:
    Apr 2013

    Posted 31 May 2013 Link to this post

    Thanks, works like a charm.
  9. MarkSci
    MarkSci avatar
    16 posts
    Member since:
    Dec 2011

    Posted 30 Sep 2013 Link to this post

    This really helped me too Justin, thanks!
  10. Robert
    Robert avatar
    3 posts
    Member since:
    Jul 2010

    Posted 04 Dec 2013 Link to this post

    I realise this is an old thread, but as Kendo is built on jquery, you can switch off caching across the board by having this snippit either in a master page, or just on the pages that you want to disable caching on:
    $.ajaxSetup ({
       // Disable caching of AJAX responses
       cache: false
    });
  11. Jon
    Jon avatar
    3 posts
    Member since:
    Oct 2013

    Posted 10 Dec 2013 Link to this post

    Justin,

    Your buried fix was exactly what I have been digging for also. Thanks!
  12. Dan
    Dan avatar
    30 posts
    Member since:
    Oct 2013

    Posted 24 Jun 2015 Link to this post

    ServerFiltering requires an actual filter.
    Justin and Robert have working solution for non cascading DropDown 

     

Back to Top
Kendo UI is VS 2017 Ready