Do Telerik Charts support ASP.NET page output caching?

Thread is closed for posting
3 posts, 0 answers
  1. David
    David avatar
    2 posts
    Member since:
    Feb 2009

    Posted 30 Jun 2009 Link to this post

    Hi,

    I'm trying to use ASP.NET output caching (the @OutputCache directive) to cache pages containing a Telerik RadChart. However, it seems that after some amount of time the chart image URL becomes invalid, and I get an exception when I try to load a cached page. (Actually I get that RadChart popup saying "An error occurred, do you want to see a stack trace?" But if I say yes, all I get is a blank page and no stack trace.)

    At first I thought it was because the RadChart is streamed through user session, and I figured that once the session was over for the user that generated the chart, then the chart url became invalid. This seemed reasonable, so I went ahead and changed the chart to UseSession=false and set a TempImagesFolder. With this change, my charts are still served up ok initially, but it failed to fix the problem since the URLs will still become invalid after some amount of time.

    My chart image URLs currently look something like this: http://example.com/data/topic/ChartImage.axd?UseSession=false&ImageName=tMecfLN%2fISaQeq5zuhXMkN0UYsBhFjHusj3p4X09SIbwkrgJ7zslmK5GNw2FM%2bOaXQAMOHUlBAO6dlo3%2b0UKOQ%3d%3d&imageFormat=Png

    So, do Telerik charts support ASP.NET page output caching? If so, how can I fix the behavior I'm seeing?

    Thanks,

    Dave

  2. Ves
    Admin
    Ves avatar
    2927 posts

    Posted 02 Jul 2009 Link to this post

    Hello Dave,

    Here is my reply to the support ticket you have posted:

    Your observations are correct. Here is how it works - the image is generated, then it is put in the cache and it is deleted (from session or from the file system). The bad news is that the expiration is not exposed as a public property, so you cannot control how long the chart will be available.

    I will forward your message to our developers for further investigation. Meanwhile, you can use the following workaround: use the
    RadChart.Save() method to save the chart to an image. Then, rather than placing RadChart in the page, use regular Image control and set its ImageUrl property to point the saved image.

    Sincerely,
    Ves
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Mark Gregor
    Mark Gregor avatar
    15 posts
    Member since:
    Nov 2006

    Posted 02 Jul 2009 Link to this post

    Thanks, Ves. That's helpful.

    I figured I could always save the file to disk and manually manage the cache, but I wasn't aware of the RadChart.Save() method. That will save me a bit of time. Thanks!

    Regards,
    Dave
Back to Top