Peter's Gekko

Sponsors

The Lounge

Wicked Cool Jobs

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Disabling the SQL Reporting Services cache

SQL Reporting Services keeps a copy of every report rendered in its cache. Of course this is quite a performance boost when a lot of users request the same report over and over again. But in our case this cache turned against us. We have an ASP.NET app whose reports are included in the app as a bunch of links to the reporting server. The page assembles the URL with the parameters (more on that later) and redirects the user to the report. Every time the user opened a report she was confronted with the previous version rendered. Based on the previous parameters. Clicking the the RS toolbar's refresh button (NOT the browser's refresh button) led to the intended report.

You can configure the caching of reports in great detail. It's under the execution tab in the report manager.

But there is a little quirk in this. Even when you set the report to Render this report with the most recent data, the user is (in our scenario) still confronted with a cached copy. This is either a bug or a misunderstanding between me and RS, I've seen others. What helped me here was using the rs:ClearSession parameter. In our app this is now the base URL for a report.

protected string reportServer
{
    get
    {
        return System.Configuration.ConfigurationSettings.AppSettings["ReportServer"] + "{0}&rs:Parameters=false&rs:Command=Render&rs:ClearSession=true";
    }
}
 

The report name and parameters go into the {0}

To be continued.


Posted Wed, Oct 5 2005 2:46 PM by pvanooijen
Filed under:

[Advertisement]

Comments

mok wrote re: Disabling the SQL Reporting Services cache
on Tue, Apr 18 2006 12:29 PM
Hi Peter, I know this post is old, but I'm having the same confusion...

I tried to work out what was really happening by creating a test report that was set to cache for 60mins with the label containing current datetime (this would really = the rended datetime of the cached report)

using the RS refresh or view report didn't change this field value so I'm not convinced that the rs refresh button actually works!

any ideas?
pvanooijen wrote re: Disabling the SQL Reporting Services cache
on Wed, Apr 19 2006 9:58 AM
hi Mok,

it's an old post but my blog is alive :)

These settings worked in our scenario but we did experience more and even weirder caching issues with RS. In one case we uploaded new report defintions, did see the new reports in the reportmanager, but the clients kept seeing the old version for days and days. Up till now we havn't found out what or who to blame :/

RS is quite nice but does have its quirks. In case we find anything usefull I'll blog.

David McCarter wrote re: Disabling the SQL Reporting Services cache
on Thu, Jun 22 2006 3:52 PM
I tried your suggestion, but the report still does not refresh correctly. Any ideas why?
pvanooijen wrote re: Disabling the SQL Reporting Services cache
on Fri, Jun 23 2006 5:17 AM
David, I'm afraid not. We're also still seeing some unintended caches. Which show rows which were deleted from the DB days ago! Reproducable, for specific selections in the report. I wish I knew what's going on.
sinfulmonk wrote re: Disabling the SQL Reporting Services cache
on Mon, Jun 26 2006 9:56 PM
It works!!!  Excellent post. Thanks.
Bonginkosi Ngubane (GMSI) wrote re: Disabling the SQL Reporting Services cache
on Tue, Sep 12 2006 11:28 AM

it worked for me... dont know if its gonna work 4ever thou...

You are The Man..

Mathias wrote re: Disabling the SQL Reporting Services cache
on Tue, Nov 28 2006 10:27 AM

Found another aproach in a Google group: pass an additional parameter in the URL that changes everytime, like a random number or current datetime. Supposedly Reporting Services recognizes that there's a different parameter (even if the parameter is not actually used in the report) and refreshes the cache every time the report is loaded. Worked for us.

pvanooijen wrote re: Disabling the SQL Reporting Services cache
on Tue, Nov 28 2006 1:41 PM

Nice ! Good there is another way as my way did not work for evrybody :)

Maddog wrote re: Disabling the SQL Reporting Services cache
on Wed, Dec 13 2006 12:52 PM

Mathias, how did you get around having to add the dummy parameter to every report?  When I add a parameter with the current timestamp to my report URL I get back an error message from the RS engine saying an attempt was made to set a report parameter <parm omitted> that is not defined in this report.  I am not wanting to add a new parm to 300+ reports in our library.  Is there a way to force the RS engine to ignore unmatched parms?  

Ivan wrote re: Disabling the SQL Reporting Services cache
on Fri, Jun 15 2007 10:41 AM

We are using the tip about include:

&rs:Command=Render

&rs:ClearSession=true

&rc:Toolbar=true

&rcarameters=true

&rc:emissionTime=<TimeTicks>

Were &rc:emissionTime= is a parameter that we add with the time ticks (in JavaScript tt= new Date().getTime(), then our URL is different each time that the user invoke the call to the report:

http://[ReportServerName]/ReportServer/Pages/ReportViewer.aspx?/Reporting+Services+Tests%2fMyTestReport&rs:Command=Render&rs:ClearSession=true&rc:Toolbar=true&rcarameters=true&rc:emissionTime=1181917533962

Using the extra parameter &rc:emissionTime=<TimeTicks>, and the others that I have mentioned above, our reports are working properly and we have not more rsExecutionNotFound errors.

Thanks, and regards

Iván

anne wrote re: Disabling the SQL Reporting Services cache
on Tue, Sep 25 2007 3:54 AM

Where should i put the things below? Im using reporting services in windows application...

&rs:Command=Render

&rs:ClearSession=true

&rc:Toolbar=true

&rcarameters=true

&rc:emissionTime=<TimeTicks>

thanks...

Craig Mpofu wrote re: Disabling the SQL Reporting Services cache
on Thu, Nov 22 2007 9:18 AM

Hi Bonginkosi

What are your new contact detail.My email is craigkq@hotmail.co.uk

David Roys wrote re: Disabling the SQL Reporting Services cache
on Mon, May 12 2008 6:57 PM

Thanks for this post - you really helped me out of a tight spot and fixed my problem. I had a SharePoint site witha URL that was being built to render a report as PDF - but it wasn't picking up the latest report definition, until I added the &rs:ClearSession=true to my URL. Thanks Heaps!

Christen wrote re: Disabling the SQL Reporting Services cache
on Mon, Jul 28 2008 4:11 PM

Thanks a million

Mike wrote re: Disabling the SQL Reporting Services cache
on Tue, Nov 11 2008 6:24 AM

I was having  report caching problems and cured them by updating the properties of the Reports directory in IIS. On the HTTP Headers tab I added a Custom HTTP Header of Cache-Control with a value of no-cache.

Jaap wrote re: Disabling the SQL Reporting Services cache
on Tue, Jun 16 2009 8:24 AM

You're my hero! Finally got rid of the SSRS 2008 caching...

tugba wrote re: Disabling the SQL Reporting Services cache
on Fri, Nov 20 2009 6:45 AM

thanks a lotttt!!

it really works..

Gaurang wrote re: Disabling the SQL Reporting Services cache
on Sat, Dec 12 2009 12:46 AM

Hi Mike,

Adding a Custom HTTP Header of Cache-Control with a value of no-cache, really cured the issue. Thanks a lot.

Ankur wrote re: Disabling the SQL Reporting Services cache
on Tue, Mar 16 2010 5:16 AM

Hello ,

How to add no-cache parameter to SSRS 2008 ?

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Devlicio.us