Search code examples
javaservletsjackrabbitjcr

Performance impact of using jackrabbit to store static content like images and read them using servlet and stream as an image to the user?


I want to use apache jackrabbit to store static content of a web page (mostly images) and want to deliver it to the user using a servlet whenever a request come to the server for an image. My question is do you see any performance impact of this. As every time a request hit the server i will login connection with apache jackrabbit and deliver images (content) to the user as a servlet response. More code here :How to store images to jackrabbit and deliver those images to HTML pages?

Note: I donot want to use apache HTTP Server and manually handle storing of images and retrieval and unauthenticated download of resources.


Solution

  • Creating JCR sessions on Jackrabbit is cheap in terms of performance, and if you use the DataStore there's a quite direct path from the the on-disk binary stream to the response socket, assuming your application doesn't add any extra layers.

    That being said, this is something that I would measure myself, in my own environment - serve images both with a plain HTTP server and with your app on Jackrabbit, saturate the servers with enough client requests and check what you get.