API & Caching

Options
I have xano db api endpoint that shows the results sort by random, I was wondering can I cache this random results with user id?
so that every time when the same person query, the sort results (sort randomly) is the same

Comments

  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    yes absolutely - you can enable caching on each api request.
    [Screenshot_2021-07-19_23-44-07.png]
  • Knight
    Knight Member
    Options
    do we need to handle invalidate the cache ourself? or any update on the record will invalidate the cache?
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    the response cache is invalidated based on the TTL which is in seconds.

    if you want more fine grained control (but more steps), then you can hand roll your own method using the data caching section in the function stack.