Fusio HTTP Result Caching

25 views
Skip to first unread message

Mathew Tasalloti

unread,
May 28, 2022, 5:38:49 PM5/28/22
to Fusio
This is working so well !  Thanks Christoph and team.  

Question:   I thought Fusio did this but just can't find this in the documentation - using HttpProcesor, are we able to cache the results of larger queries for faster responses?

For Example:
1)  Consumer X makes are request to Route Y ... this takes 20 seconds to process.
2)  Consumer Z makes a request to Route Y in 30 seconds ... is there a way of caching the results for route Y from step 1 ?
3)  Ideally be able to set a setting to say Route Y can only be run, say, every 5 minutes and if it gets called more frequently, then send back the results we already have. 

Use case would be:

"As an administrator I'd like to be able limit expensive HTTP -forwarded hits on the upstream server, but still provide results to the consumers by setting a time threshold during which if the same expensive route is requested, then we send back the results we have on hand.  If we don't have a result for the route during the threshold period, then Fusio can submit the query to the upstream server."

Is there a feature like this that we can utilize today?  My apologies if it is in the docs - just can't seem to find it.

Thanks,
Mathew

Christoph Kappestein

unread,
Jun 2, 2022, 2:16:09 PM6/2/22
to Fusio
Hi Mathew,

so for this use case we have currently the "Util-Cache" action, at this action you can select another action which should be executed and the action then caches the result of the triggered action. This means in your case if Consumer X makes a request which creates the cache then the next request from Consumer Z gets served through the cache without invoking your endpoint. You can then simply configure the amount of seconds how long the cache should be valid s.

util_cache.png

best regards
Christoph

Mathew Tasalloti

unread,
Jun 29, 2022, 8:28:06 PM6/29/22
to Fusio
Hi Christoph!

Fantastic and thank you very much.   I swore I saw this in the docs but couldn't find it again ... I'm on it !

Many thanks.

Best Regards,
Mathew

Christoph Kappestein

unread,
Jun 30, 2022, 3:15:32 PM6/30/22
to Fusio
Hi Mathew,

ok great, and also I hope everything is working so far for your case.

best regards
Christoph
Reply all
Reply to author
Forward
0 new messages