This is a migrated thread and some comments may be shown as answers.

OutputCache not working with Remote Data Binding

4 Answers 67 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 29 Dec 2014, 10:25 PM
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);
}

4 Answers, 1 is accepted

Sort by
0
Bob
Top achievements
Rank 1
answered on 29 Dec 2014, 10:27 PM
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);
}
0
Atanas Korchev
Telerik team
answered on 31 Dec 2014, 02:54 PM
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.

 
0
Bob
Top achievements
Rank 1
answered on 31 Dec 2014, 03:11 PM
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!
0
Bob
Top achievements
Rank 1
answered on 31 Dec 2014, 03:12 PM
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.
Tags
DropDownList
Asked by
Bob
Top achievements
Rank 1
Answers by
Bob
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or