Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
Confirm whether or not cache is unique to the current user?

Hello, I'm looking to add state to a complex workflow, and was considering the use of Q2's Caching to help manage this.
My concern is that the cache is accessible to all users, thus overriding any statefulness and potentially exposing other user's data.

Can someone confirm whether or not cache is unique to the current user?

Votes Newest

Answers


Unique or not unique depends on the key used to stored the information in the Q2 cache. When information is stored in cache, a cache key is needed to pair with the information stored. You can see in the cache section of the online banking tutorial that the the this is done with the self.cache.set function

self.cache.set('key', 'value', 15)

The 'key' is a string value that the key to pair with the information.

Since it is a string, a key that is unique to the end user can be constructed to make it unique to the current user. For example:

user_cache_key = f'info_{self.online_user.user_id}'
self.cache.set(user_cache_key, 'value', 15)

This could create the cache key "info_2" for the end user with user id 2. The login name could also be used and is also unique to each end user.

The SDK team is also about to release a new feature that will allow for caching on a per online session basis. This would allow for state to be saved for a unique end user and only durring their current session.

Posted 4 years ago
Paden Rose
77 × 1 Administrator
0

This is perfect, thank you so much!

— Khalil Aqqad   4 years ago
94 Views
1 Answer
4 years ago
4 years ago
Tags