• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
slow response of pdf
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

slow response of pdf


  • Subject: slow response of pdf
  • From: Frank Stock <email@hidden>
  • Date: Sat, 01 Nov 2014 16:26:27 +0100

Hi All,

 I have moved my application from MacOS server 10.6 to 10.9.5.
 I have done a complete new installation. The application works fine but when I create a pdf it takes about 25 seconds to see it in the browser.
The pdf is about 10MB. When I do a direct connect I can see the pdf without delay.

I have created a new Wonder Application with only the following code:

public WOActionResults fichePrint() {
String filename = "/tmp/test.pdf";  // test.pdf is a 10MB file
ByteArrayOutputStream outputStream=null;
try {
outputStream = new ByteArrayOutputStream();
InputStream inputStream = new FileInputStream(filename);



int data;
while( (data = inputStream.read()) >= 0 ) {
    outputStream.write(data);
}
inputStream.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


// It takes 8 seconds to load the file

System.out.println("Read");


WOResponse response=new WOResponse();
response.setHeader("application/pdf", "Content-Type");
response.setHeader(Integer.toString(outputStream.size()), "content-length");
response.setHeader("inline;  filename=test.pdf", "Content-Disposition");
response.setContent(new NSData(outputStream.toByteArray()));







return response;
}

Has this something to do with Apache? Where can I find more information to solve this?

Thanks in advance,
Frank Stock
Belgium


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: slow response of pdf
      • From: Kevin <email@hidden>
  • Next by Date: Re: slow response of pdf
  • Next by thread: Re: slow response of pdf
  • Index(es):
    • Date
    • Thread