Cache widget #492
wesleyrob9
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! I have a question about the caching system in Stac.
I'm building a Flutter app using Stac for Server-Driven UI, but I am not using Stac Cloud. I have my own backend API (Python) that returns the Stac JSON screens.
I would like to use the built-in Stac caching strategy, especially StacCacheConfig with StacCacheStrategy.cacheFirst.
For example:
await Stac.initialize(
cacheConfig: const StacCacheConfig(
strategy: StacCacheStrategy.cacheFirst,
maxAge: Duration(days: 7),
),
);
My question is:
Can the built-in Stac cache (StacCacheConfig / StacCacheStrategy) be used with a custom backend/API instead of Stac Cloud?
If yes, how should I configure the custom API URL so that Stac fetches the screen from my backend and stores/reads the response using the built-in cache?
If the built-in cache is only intended for Stac Cloud screens, what is the recommended way to implement cacheFirst for a custom backend while still using Stac to render the screens?
Thanks!
All reactions