User criteria in Service Portal is cached ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2018 07:54 AM
On a widget instance, I would like to apply a user criteria as described in the documentation.
The user criteria is advanced and it would return true if the user have active requests and false if the user has no active active requests.
The issue I'm facing, is that the first time the widget instance is displayed on the service portal, the user criteria is correctly evaluated e.g. the widget instance is not displayed if the user has no active requests. But then the user create a request, the widget instance should be displayed, but it is not. But after some times, the widget instance displays.
Same issue the other way : if the user has active requests, the widget instance is correctly displayed, but then, all his active requests are closed, the widget instance should not be displayed, but still be. But after some times, the widget instance is hidden.
It sounds like the user criteria result is cached. But in this exemple, it is not good for the user experience.
Has you face this issue? If yes, was you able to resolve it and how ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2018 06:44 AM
Hi John,
Here the feedback from /hi
"Hello, I have had a look into this issue and can see that there has been a PRB: PRB1292080 raised for this issue. This has been closed as 'Working as Expected'. The development mentioned: Script will be evaluated as far as it is not cached. The User Criteria is cached for a user as far as User record or User Criteria record does not change. So if role, group etc changes the cache is flushed immediately. So if you disable the cache it will always evaluate the script. From design it is assumed that the Access to a resource will not change in time. A User will either have access not won't have access and we cache this result for better performance. The dev has also mentioned that if User Criteria needs to be used, then disable the User Criteria cache. But it will have its own performance implications. I will now put this into a 'Solution Proposed' state. If you have any further questions, please let me know. Otherwise, please kindly archive this incident. Upon closure of this incident, there is a Customer Satisfaction Survey for you to complete. We would really appreciate the feedback you provide to us!"
Then form /hi again
"Hello , I have spoken to the development team regarding this. In order to disable the system cache there is a system property: glide.cache.disabled.user_criteria_cache which can be set to false. This will disable the user criteria cache. This will need to be created on the sys_properties table. Please test and let me know how you get on. Kind regards,"
And my feedback:
=> actually, the system property glide.cache.disabled.user_criteria_cache must be set to true to disable the cache (not false) => I have done some tests, and it works as expected. Halleluia!
=> Looking at the logs, I confirm that it can have some impact on the performance (when the page loads, instead of being evaluated one time, the user criteria is evaluated multiple times, maybe because of angular stuff...)
=> With my current customer, we will do some tests in order to undestand if the impact on the performance is big or not.
I hope it helps.
Ximizu
Co-founder of CloudSpirit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2018 08:49 AM
Interesting... my HI ticket never mentioned the glide.cache.disabled.user_criteria_cache.
I created the sys_property, and set it to true, but it does still seem to be caching. I have log statements in my User Criteria so I can see when they evaluate, and it does evaluate the first time, it does not seem to evaluate after that. Log out/back in doesn't seem to force it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2018 08:54 AM
I did find if I cleared the system cache (cache.do), it will re-evaluate the User Criteria the next time. Ideally, I'd like to not clear the cache that frequently..