How to Disable Caching

7 posts, 0 answers
  1. Fernando
    Fernando avatar
    66 posts
    Member since:
    Sep 2012

    Posted 22 Jul 2015 Link to this post

    good morning

    When I run a report in this reportViewer generating a cache of information.

    When I change the value of information in the database and run the report again, the report is still with the old information.

     

     $("#reportViewer1").telerik_ReportViewer({
                serviceUrl: "api/ReportClient",
                templateUrl: "Content/reports/templates/telerikReportViewerTemplate-9.0.15.324.html",
                reportSource: {
                    report: "{ id : 81 }",
                    viewMode: telerikReportViewer.ViewModes.PRINT_PREVIEW,
                    scaleMode: telerikReportViewer.ScaleModes.FIT_PAGE_WIDTH,
                    scale: 1.0,
                    PersistSession: false
                }
            });       
        });​

     

    //SERVICE

     public class ReportClientController : ReportsControllerBase
        {
            protected override IReportResolver CreateReportResolver()
            {
                return new ClientReportResolver();
            }
            protected override ICache CreateCache()
            {

                var cache =     Telerik.Reporting.Services.Engine.CacheFactory.CreateFileCache(HttpContext.Current.Server.MapPath("~/App_Data/CustomReports/cache"));
        return cache;
            }​

     

    I've tried removing the overhead of the method but the reportViewr exisge this overload

     

  2. Stef
    Admin
    Stef avatar
    3610 posts

    Posted 27 Jul 2015 Link to this post

    Hello Fernando,

    Please test the suggestions listed in my posts in the Web Api Caching and resolving issues forum thread.

    Let us know if you need any further help.

    Regards,
    Stef
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Naveen
    Naveen avatar
    1 posts
    Member since:
    Feb 2018

    Posted 24 Oct 2018 in reply to Stef Link to this post

    Hi Stef,

    I'm trying to disable report caching in my Telerik report Web API and i did refer to "Web API Caching and resolving issues" forum thread. But, I guess most of the information provided there is to set time outs to avoid cached reports or set a Data-time parameter to create a new report every-time.

    But is there a way to avoid the caching at all?

  4. Silviya
    Admin
    Silviya avatar
    258 posts

    Posted 29 Oct 2018 Link to this post

    Hi Naveen,

    Can you please elaborate about the reason of fully disabling caching?

    However, in order to force the service to render the report each time anew instead of returning its cached version, you need to pass a different report parameter value. A possible workaround is to pass a DateTime.Now or another unique value via a report parameter (hidden), which will guarantee that the report is processed each time it is requested.

    Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. Ilya
    Ilya avatar
    1 posts
    Member since:
    Jan 2019

    Posted 28 Jan in reply to Silviya Link to this post

    Hi Silviay,

    I have the same issue. Could you please provide an example how to pass DateTime.Now as report parameter value?

  6. Silviya
    Admin
    Silviya avatar
    258 posts

    Posted 30 Jan Link to this post

    Hi Ilya,

    You could pass a built-in function =Now() as value of the report parameter. For more information - Date and Time Functions.
    Please check this screen shot for reference - https://www.screencast.com/t/0tZixwWvh.

    Regards,
    Silviya
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  7. Oleg Kokorin
    Oleg Kokorin avatar
    1 posts
    Member since:
    Jan 2009

    Posted 31 Jan in reply to Silviya Link to this post

    Silviya,

     

    Thanks for your reply. But my problem was related with a custom resolver. And I fixed that.

Back to Top