Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are a cache strategy or a way to do server-side pre-processing? #190

Open
ppKrauss opened this issue Nov 22, 2016 · 2 comments
Open

Comments

@ppKrauss
Copy link

The convertion process (lens_converter.js) is time consuming... There are a cache strategy for it?

... I have all XML JATS files in a database, that can be pre-processed by Node.js in the server, and cached in the database... But there are a simple way to cache a JSON structure? As I see there are a lot of DOM objects, that will be not saved in a simple JSON structure.


Another advantage to cache is that my server-side converter/lens_converter.js can grow with dozens of Converter.Prototype options without overload the client-side.

@CAYdenberg
Copy link

As I understand it, the converter relies on the browser-native DOM parser and won't work in Node. I've toyed with parsing in the browser and then firing the JSON back to the server when complete - but there isn't any obvious way of knowing when the converter has finished - it's all async. (Note that the loading animation you see depends on a setTimeout - it's not necessarily as time consuming as you think it is).

@ppKrauss
Copy link
Author

Thanks @CAYdenberg, good analysis. Yes ideal to work with Lens also at server-side, so running with NodeJs... Perhaps we need to open other issue, to suggest it server-side Lens?


About my particular use of Lens. The cache is a way to pre-process, validate and deliver... Some XML (eg. try any PLOS ONE as this sample, testing <ref-list> renderization) need also XSLT pre-processing, but not need to save another XML duplicating it, the easyest way is to save as "LensCache".

Note that the loading animation you see depends on a setTimeout - it's not necessarily as time consuming as you think it is

Perhaps is not so relevant for final users at universities, but we want to offer better experience: the client-CPUtime is not null ... it is order of seconds in old computers and mobile devices (eg. tablets).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants