Cache some variables in memory like memcached or redis and only visible in my scoped application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2017 06:54 PM
I use `sn_ws.RESTMessageV2` in Business Rule and some variables must be saved to reuse next for a while, for example, cookies, token. As a matter of convenience, I use to system property to store them, but after reading [Add a system property](Add a system property ), It says:
Some properties in the system are not visible in an instance by default and must be added to the System Property [sys_properties] table. You can add a system property if a feature requires the addition of the property.
Important: System properties store configuration information that rarely or never changes. Each time you change or add a system property, the system flushes the cache to keep all nodes in the cluster in synch. This cache flush has a very high performance cost for one to ten minutes, which can potentially cause an outage if done excessively. To prevent such outages, do not use a system property to store configuration information that changes more than once or twice a month. Instead, use a custom table to store regularly changing configuration information.
It recommend me to use a custom table. So, is there any way to cache some variables with high performance?
Moreover I also find Business Rules or Script Includes are always re-loaded and re-executed, in which, defined variables cannot retain their previous value.
And
RESTMessageV2 - setAuthenticationProfile(String type, String profileId)
Set the credentials for the REST message using an existing basic auth or OAuth 2.0 profile.
Name | Type | Description |
---|---|---|
type | String | The type of authentication profile to use. Valid values are 'basic' to use basic authentication, or 'oauth2' to use OAuth 2.0. |
profileId | String | The sys_id of an authentication profile record. When using basic auth, specify the sys_id of a Basic Auth Configuration [sys_auth_profile_basic] record. When using OAuth 2.0, specify the sys_id of a OAuth Entity Profile [oauth_entity_profile] record. |
- Labels:
-
Best Practices
-
Scoped App Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2017 11:01 PM
have you tried using GLOBAL VARIABLES?
TechNow Episode 10 | Faster Access Control List Rules - YouTube Chuck and Andrew explained the use of global variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2018 07:35 AM
Hi,
I tried the suggested solution in Kingston, but it ain't working. Can you please update if you tried the solution in the video and it worked for you?
Thanks,
Tomer