Hi all,
Has anyone attempted to store the rendered output of VexFlow, so that it could be returned to the user without much processing required in the frontend?
For example in PHP, when you have some expensive object to create, you can generate it once, then serialize() it to string and save it disk, cache, or DB. Later when the user needs this, you can just unserialize() and the object comes into scope without the expense of the generation function.
I have many scores being parsed using the MusicXML plugin Dan created; and find that loading, parsing, and rendering this stuff every single time on the client frontend is a bit wasteful; given that the end output is always the same.
I was thinking that this could be done server-side once per score: using something like PhantomJS to render the score, and then to somehow store the created DOM and somehow store the relevant JS variables. The instead of running all the parse stuff on the client, we just return some HTML with a < script > tag containing the hydrated JS vars.
Anyone tried this before or have some ideas on how to achieve it?
thanks,
Cyril