Personally I don't think I've ever used it in prac...
# suitescript
e
Personally I don't think I've ever used it in practice. I've seen a few others around here use it in long-running scripts, like a Map/Reduce, or perhaps Client Scripts that require large datasets.
👍 1
s
I have a few fears, the first being, if my MR runs concurrently with multiple deployments, the second being how we design to define the cache, and henceforth how we call it?
e
I will refer you to the much smarter folks around here for those answers 🙂
s
I tend to use
N/cache
only with M/R scripts to overcome the limitation that each stage gets its own memory space. For example, I may lazy load search results used in a
map()
stage. If the cache item hasn't been initialized it run the search, otherwise returns the result set (array).
I tend to name cache entries after the script name with a suffix.
My intent with this technique is to replace what you could otherwise just capture in a script global variable in a scheduled script.