Automatically cache clearing in service now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 06:48 AM
Hi all,
I am facing a typical requirement which is related to add to cart functionality.
The requirement is first we have to add few items A*, B, C to the cart and just after adding A to the cart we have to hide item 'A', so that user cant able to add it again.
My approach : So we have used User criteria for hiding the item which returns answer = true/false on the basis of row count of cart. if row count greater than zero then it will hide.
Problem faced : After deleting the item A from the cart it will not reappear to user. So it means that cart is not emptied even after deletion of the item. However if I cleared the cache manually by adding cache.do in url then the item will reappear to the user.
So what I require to know that is there any method available to clear cache 'while deleting the last item from the cart'? Or how can we regained that hidden or previous item.
I have found a function gs.cacheFlush()but i am not getting any significance for How to use it.
Please required urgent help!!!
Thanks in Advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 07:00 AM
Hi Ash Shri,
In my opinion, it is normally not a good practice to do the cache clearing during business hours, try for some other alternatives. Still if you want to do it simply call cache.do in any of your server side script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 07:01 AM
gs.cacheFlush() is a server-side method to clear the entire server cache, which you do not want to do in your scenario because it will lead to decreased performance for all users.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2017 07:26 AM
As far as I know, scripted user criteria are not supposed to be cached. It could make sense to reach out to customer support to find out if that's indeed the expected behavior.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2017 12:19 AM
I still not found any solution !!