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
Set cache to expire when session ends.

Hello,

Is it possible to set the cache to expire when a session ends or when a user logs out, instead of setting a fixed time?

I'm using self.cache.set("key", "value", "exp time") to set the cache currently. Is there any other way?

Thank you
Indika

Votes Newest

Answers


Indika, instead of trying to calculate the right expiry time. Our suggestion is to prefix the "key" with the self.online_session.session_id. That will generate a new key with each session.

Posted 4 years ago
Ryan Hollister
196 × 4 Administrator
115 Views
1 Answer
4 years ago
4 years ago
Tags