Report Caching

Stimulsoft Reports.PHP discussion
Post Reply
PeterG
Posts: 20
Joined: Sun May 25, 2025 8:22 pm

Report Caching

Post by PeterG »

When I run a PHP report in localhost the most recent changes are not displayed - even a day later. How can I get the report to reflect the latest changes short of clearing the cache each time, something I would prefer not to have to do?
Lech Kulikowski
Posts: 7729
Joined: Tue Mar 20, 2018 5:34 am

Re: Report Caching

Post by Lech Kulikowski »

Hello,

What do you mean by "recent changes are not displayed"? What changes are not applied?

Thank you.
PeterG
Posts: 20
Joined: Sun May 25, 2025 8:22 pm

Re: Report Caching

Post by PeterG »

What I mean is that I am building the report and testing as I go along. If I add a field or move things around on the report, I don't see the change reflected in localhost. I'm building the report in the same folder that localhost points to so changes to the report should be reflected immediately.
Lech Kulikowski
Posts: 7729
Joined: Tue Mar 20, 2018 5:34 am

Re: Report Caching

Post by Lech Kulikowski »

Hello,

The browser caches static files based on their URL.
You can use the following code to load the report:
$report->loadFile('../reports/SimpleList.mrt?v= . rand()');
This way, the URL changes each time, and the updates will be visible immediately.

Thank you.
PeterG
Posts: 20
Joined: Sun May 25, 2025 8:22 pm

Re: Report Caching

Post by PeterG »

Thanks for the tip.
Lech Kulikowski
Posts: 7729
Joined: Tue Mar 20, 2018 5:34 am

Re: Report Caching

Post by Lech Kulikowski »

Hello,

You are welcome.
Haizal_Casper
Posts: 2
Joined: Sat Mar 21, 2026 9:22 am

Re: Report Caching

Post by Haizal_Casper »

That random parameter trick is definitely the way to go for development. It’s such a lifesaver when you're making constant tweaks and the browser just refuses to let go of the old version. Glad to see this solution works for the PHP reports too!
Lech Kulikowski
Posts: 7729
Joined: Tue Mar 20, 2018 5:34 am

Re: Report Caching

Post by Lech Kulikowski »

Hello,

We are always glad to help you.
Post Reply