2 Answers, 1 is accepted
Hi Alwin,
Indeed, when you use FileStorage, our REST Service generates a structure of folders and files that keeps the state of each client/viewer that uses the service. Periodically, the assets get cleaned by the service. How long a client will be kept alive depends on the REST Service properties ClientSessionTimeout - see the article HTML5 Report Viewer and Reporting REST services.
Periodically (each 5 min), the Rest Service performs cleaning of the expired sessions. Note that in order for the service to clean the inactive sessions it has to be awakened by a request from an active client/viewer. Hence, all inactive sessions will be deleted after some time that is determined by the ClientSessionTimeout and the time intervals in which the inactive sessions get removed from the service, provided the service is awake.
If the service stops before the client sessions have been deleted (including before it has been awakened to delete them), the uncleaned sessions will remain in the Storage. The data will be useless, but it will not be removed as the REST Service has already stopped before there has been a request to awaken it and let it automatically clean the expired storage data. In such cases, you need to manually clean the storage. That said, you need to delete manually the folder C:\WINDOWS\Temp\Html5App each time the REST Service stops. This way, you will remove the leftovers and prevent the unnecessary increase of occupied storage. While the REST Service runs normally, it takes care of its expired assets and the cleaning happens automatically.
Regards,
Todor
Progress Telerik

Thanks Todor, two questions:
1. Surely it will take some time for the inactive sessions to be removed and the REST service will only running for a relatively short time ie. just enough time to serve the report. It will only everrun for a few seconds and then stop - is this generally enough time for the cleanup to happen?
2. I noticed that in my resolver the timeout had been commented out, does this mean that some default timeout is applied or that there is no timeout hence why my cache files are not being deleted?
configurationInstance = new ReportServiceConfiguration
{
HostAppId = "Html5App",
Storage = new FileStorage(),
ReportResolver = new MyResolver(),
// ReportSharingTimeout = 0,
// ClientSessionTimeout = 15,
};
1. The REST Service initiates cleaning each 5min. In the worst case, you need to add also the ClientSessionTimeout to get the actual time after which the storage will be cleared from the expired assets, provided the service is awakened. If the service runs for a few seconds only and then is forced to stop, it cannot clean its storage and you need to do this manually.
2. Indeed, there is a default ClientSessionTimeout that is 15min - check ReportServiceConfiguration.ClientSessionTimeout Property. You may set it to a lower value. Still, the 5min period for initiating the cleaning process will remain.
I think I understand the behaviour, I just can't see what would cause the service to run for longer than a few seconds ever, I mean surely it only ever runs as long as it takes to serve the report (which will be quick)?
Based on this I see that ti would always be my responsibility to do the cleanup?
Generally, the service runs while the project it is embedded in is running. Do you mean that you stop the project after rendering the reports? If so, indeed, you will have to take care of storage cleaning.
If the project with the service is running for a long period, the REST Storage will be cleaned periodically. Let's say the client "1" has expired and another client, "2" is accessing the service. In this scenario, the service is awakened by client "2" and the expired client "1" assets will be deleted by the service.