Alex Art.
Alex Art.

Reputation: 8781

Render Raphael charts(SVG) on server side or stick with ajax and client side rendering?

I have MVC3 application that draws some charts using gRaphael library. I use ajax to submit the input from client and as a response, I get Json that contains all the data needed to draw the charts. I know that server side rendering is faster and more preferable approach but i also know that gRaphael library doesn't support server rendering out of the box and it still needs some JavaScript to be executed on client side. I heard about PhantomJS as a work around but I am not familiar with it and i also heard that there are some issues using it for SVG rendering.

So my questions are:

  1. Should i even try to find a solution to render those charts on server side (Will i get major performance improvements by moving the rendering to server side)?

And if i should, what is the best practice to do it?

Thanks in advance!

Upvotes: 1

Views: 541

Answers (1)

Brian Herbert
Brian Herbert

Reputation: 1191

I have similar situation but it's the other way around. My website takes some inputs from the user and then renders an image on the server and returns it to the page. I have found that my cloud compute bill is quite big and I want to reduce it by moving the image rendering onto the client (using Raphael). Also server side processing is less responsive. I am not sure how you should render the image on the server anyway. Most .NET dlls were designed to work with WinForms or WPF so could have problems with concurrency; I am using System.Drawing.Graphics.

My problem is that I do not know how to post the Raphael graphic back to the server.

I would suggest that you keep using client side rendering as server side is too expensive and it does not work very well with System.Drawing.Graphics.

Another possibility may be to use Silverlight although I would stick with Raphael.

Upvotes: 1

Related Questions