On 05/09/2017 01:37, Erik Peterson wrote:
How can I create a variable that is evaluated only once but accessed across many RestXQ requests and sessions. I'm trying to cache data that comes from an integration with an expensive operation. Does BaseX support something similar to server variables like Mark Logic?
Hi Erik,
AFAIK you have the following possibilities to keep a variable live accross multiple RestXQ calls:
1) Use session http://docs.basex.org/wiki/Session_Module
2) Use a database which is builtin in BaseX and is very lightweight. Especially if your data is serializable to XML you could benefit also from indexes to speed up access to your cached objects.
3) Use the file system.
Hope this helps [cit] ;-)
Marco.