Response caching reset via API

Options
Hello Guys,
I hope you are all well.
I am experimenting with caching to improve perf of my app and one of the use case I have is caching the response on the user level (auth-level) but I want to be able to scrap it anytime certain API gets hit.

Basically my users create a training plan which lasts a couple of months hence I see a lot of response caching potential in many APIs however they can update or re-create a plan anytime (although on average they would not it often). I was thinking if there is a way of plugging a response cache reset of a certain API under the stack of another API. Delete cache does not seem to be the right solution as we cannot access cached response there just variable we previously pushed. 
Basically if I cache an API responses for 24 hours now, there is a risk that user will happen to recreate the plan and won't be able to see the updated version for 24h.

Comments

  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
     

    I would recommend taking a look at the Data Caching function stack category. That lets you use caching on a more granular level where you can pick and choose exactly how you want to do things.

    There is also function caching which can be very handy. If you can encapsulate your business logic in functions then you can enable caching on the function level instead of the request level.
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    here is some documentation on it - https://docs.xano.com/working-with-data/functions/data-caching

    btw the api caching is in the api query settings menu and function caching is in the function settings menu.