zumult-org / zumultapi

1 stars 0 forks source link

Consider a general solution for caching (on the server) for large objects #181

Open berndmoos opened 10 months ago

berndmoos commented 10 months ago

... or objects which are expensive to calculate. An example in TGDP would be the list of all speech events with some metadata. This takes several seconds to retrieve, but it is actually a constant, because it will only change at release time (i.e. when speech events are added). ZuMult at AGD should have similar cases (e.g. all ZW events or very large transcripts as in UNSD).

There seems to be a framework for this kind of problem, see here: https://stackoverflow.com/questions/699996/java-web-application-how-to-implement-caching-techniques (post is 14 years old, though)

Need to understand better, before I try...

berndmoos commented 10 months ago

Most simply, a static variable (in a servlet) which stores the value once it has been calculated, seems to do the trick. As far as I understand, this variable is available globally, i.e. it does not have to be intitialised for each different call of the servlet. However, this is probably not a good idea for objects with a lot of instances (such as transcripts).