Response caching reset via API
Options
![Lukasz Kwiatkowski](https://us.v-cdn.net/6037124/user_avatars/2118965.jpg)
Lukasz Kwiatkowski
Member ✭
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.
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
-
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. -
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.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback