Hello,

I have a question about Aggregate caching. Is this done for a specific (user) session or done globally - any user access that particular table through the aggregate comes from the cache (cached previously by another user) ?

Thanks in advance.


Hello Siya,


The cache in minutes  property will cache the aggregate results in the front end server. This is not per user. 


Hope this helps !!!

Hi,

Some more detailed description (abstract from OutSystems documentation)

Regards,

Daniel

Thanks Amal & Daniel for the information.

Basically this means whenever an aggregate is invoked it will be cached (based on the timeout specified). And the subsequent call to same aggregate will fetch the data from the cache. What I am not sure is

-Say we have an entity Employee and have 2 server actions  calling the Employee data ( Get All Employees with same set of parameters with different caching timing ). So the caching happens at each methods or at an aggregate level ? 

One could easily verify this by looking at the queries getting executed at the SQL Server ( using some profiler ) but that require an on premise installation or having access to the SQL server. 

If someone has more insight on the same, please share. 

The caching happens for either the aggregate, advanced SQL, server action or webblock where you set the cache in minutes webblock.

If you have two identical aggregates developed used in different server actions they are as far as I know cached separately, even if both have same cache in minutes.


https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Implementing_Logic/Logic_Elements/Server_Action


https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Web_Interfaces/Navigating_in_the_Application/Web_Block


https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Data/Handling_Data/Queries/SQL

This is easy to test with just OutSystems

Solution

siya wrote:

-Say we have an entity Employee and have 2 server actions  calling the Employee data ( Get All Employees with same set of parameters with different caching timing ). So the caching happens at each methods or at an aggregate level ? 

Caching is done by element. 

The aggregates inside each action are different elements, so, each one will have its own cache, even if they are doing the same thing. 

And as Daniel stated, you can cache different elements. 

Also, if you cache an aggregate inside an action with 10 minutes, and then cache the action for 2o minutes, after the first time you call the action, the aggregate will be executed and its results will be cached for 10 minutes. But the action results will be cached for 20, so, during the next 20 minutes, its code will not be executed, meaning that the cache of the aggregate will be irrelevant. 

If we cache the aggregate for 20 minutes and the action for 10, after 10 minutes the action will be executed again, but the aggregate will be e, ecuted again only after 20 minutes. 

Cheers. 

Solution

Thanks Eduardo. Thank you for the explanation.