Should utility objects/methods be in a module or in SparkCache?
L
Luke Clark
started a topic
over 7 years ago
Hiya,
Should utility objects be placed in a module or should they be cached via SparkCache?
Specifically, I have an object in JavaScript that holds 20 or 30 utility methods (mostly underscore.js methods). At the moment, I have this object in its own module and I bring the module into a cloud code event binding via "require()". But since these utility methods aren't user-specific, would it be better to cache this object and access it via SparkCache?
Any thoughts?
Cheers,
-Luke Clark
Best Answer
C
Customer Support
said
over 7 years ago
Hi Luke
The way you have it working now is fine, there is no real benefit of using the SparkCache for something that can be used within a module. Modules are already cached, the SparkCache is more for storing state rather than functions.
Thanks,
Liam
1 Comment
Customer Support
said
over 7 years ago
Answer
Hi Luke
The way you have it working now is fine, there is no real benefit of using the SparkCache for something that can be used within a module. Modules are already cached, the SparkCache is more for storing state rather than functions.
Luke Clark
Hiya,
Should utility objects be placed in a module or should they be cached via SparkCache?
Specifically, I have an object in JavaScript that holds 20 or 30 utility methods (mostly underscore.js methods). At the moment, I have this object in its own module and I bring the module into a cloud code event binding via "require()". But since these utility methods aren't user-specific, would it be better to cache this object and access it via SparkCache?
Any thoughts?
Cheers,
-Luke Clark
Hi Luke
The way you have it working now is fine, there is no real benefit of using the SparkCache for something that can be used within a module. Modules are already cached, the SparkCache is more for storing state rather than functions.
Thanks,
Liam
Customer Support
Hi Luke
The way you have it working now is fine, there is no real benefit of using the SparkCache for something that can be used within a module. Modules are already cached, the SparkCache is more for storing state rather than functions.
Thanks,
Liam
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics