Open jesus2099 opened 8 years ago
I'm really interested by this idea, I should also decrease the number of requests made by my scripts. Let me know if I can help
Oh so you also stumbled upon that ticket! Great! :) I think it's my next task, to work on this...
@loujine tell me if you have other ideas or if some ideas are wrong or anything (the notes in the first post).
I first thought of waiting for a few seconds delay to gather all client scripts requirements in terms of &inc=
they need and then the WS call would only ask for those minimum set of &inc=
that is enough for all scripts.
But it seems simpler/faster/easier/etc. to just call the entity WS with all possible &inc=
, always.
What do you think, @loujine? :)
In order to, among other things, limit the amount of requests that is made, all scripts could share the loading of a single entity Web Service request.
loading
flag is set inlocalStorage
so that further requests will wait and use the same result, once available.Once the result is obtained, the entity is stringified in thedocument
so that all scripts can see it.It is also timestamped and cached inlocalStorage
to avoid requesting the same thing several times in the same, let’s say, minute.localStorage
to avoid requesting the same thing several times by any user script in the same, let’s say, minute.Script that requested WS entities (draft)
* all in the future (#187) \ those are shared request already