My REST API endpoint is producing a report in HTML. Name of the file is in lcfilename. My process class is doing the following to send the file to the browser. It works perfectly:
THIS.oJsonService.IsRawResponse = .T.
Response.ContentType = "application/html"
Response.TransmitFile(lcfilename,"text/html")
Problem is the file size is 4Meg so it is taking several seconds for the browser to display the report. I am thinking I should zip the file and just transmit the zip file and let the website code unzip the file. I am almost certain there is WC documentation for how to Transmit a zip file but I can not find it. Can you point me to it?
Thanks, John

A 4mb file is not very large and unless you're on a really slow connection that shouldn't cause any undue delay.
You can use GZip compression on the output:
The client has to indicate that it supports GZip in order for this to work - Web Connection checks for the appropriate client header, but if your client is not a browser make sure the appropriate Accept
header is sent.
+++ Rick ---
Rick, I got that working. It may be a slow connection as the gzip did make some difference.
Something I have leared (or am learning) that may help others:
Best to do an example. My app is basically an accounting system. It can produce a financial history like a bank statement per customer. I have a desktop user asking for a statement for 1 customer. Let's say they want to see all of that customers history and the customer has been a customer for 20 years. It can take 1 or 2 seconds to display the report. No big deal. My customer will never complain about that. Even if 2 or 3 users happened to be running the same report for customers at the same time, no big deal, just a second or 2 to show the report. So now I have a website. All 1000 customers have a browser. So now I have 1000 users running that report simultaneously. The website is hitting my WC REST API to pull that report for all 1000 users. THAT IS A CHALLENGE!
I don't think the transmission time is your problem. If anything the GZip encoding makes your request slower because Web Connection has to encode that data. Once Web Connection hands off the string, IIS is serving the actual data and Web Connection can go on to serving the next request while the data is in transit.
What you're worried about is the actual Web Connection server processing time because the FoxPro server pool is limited. Everything else has plentiful resources.
If you have many slow requests you can also use Single Instancing COM Mode which runs requests outside of the Web Connection pool, meaning they don't tie up the pool while requests are processing.
+++ Rick ---
