Tim Holloway wrote:Network latency is something that you need to take up with your network administrator. Since most networks run gigabit or faster rates in-house these days, actually transferring 5-10MB shouldn't be an unreasonable delay. Heck, these days, just ordinary web page viewing can easily suck down that much data for each and every desktop in the shop*. Which is a sad commentary on most websites, but nonetheless true.
But if you are repeatedly constructing the document from scratch, THAT can hurt. It can take a relatively long time to assemble a PDF or image from scratch, so avoid doing that. Especially if multiple requesters are demanding the CPU at the same time to create the same thing at the same time. Create it once and then cache it. There are all sorts of cache mechanisms available, both for in-memory caching and online storage caching. For good measure, make sure that your document response requests client-side caching as well.
---
* I just did a quick check of a typical Ranch page. 1.58MB for the one page. Fortunately, a lot of it is client cached.
Stephan van Hulst wrote:First, you need to perform a stress test on your application, and profile it to see which part of it is causing the delay. There is no point in reducing the file size if the delay is caused by something unrelated.
Regardless, if your problem IS caused by a combination of file size and number of concurrent requests, a first step might be to try a higher compression ratio for your PDF. There is a limit to how much you can compress data before it becomes lossy though.
Finally, it might just be an issue of server resources or limited bandwidth. If you can't host your file in the cloud, then you must invest money to scale up network and server capabilities.
Note that hosting in the cloud does not necessarily mean hosting your file on a CDN without any form of protection. You can write a small application that does nothing more than authenticate a user, and then serve the file. The application can then be hosted in the cloud, and redirected to from your legacy application.