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.
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?