Autoreload and caching are really powerful. But sometimes they don't work well together.
If you have cached a function but figure out its implementation should be changed its not clear how to handle this. So what I normally do is to restart the server. This is a slow process.
What alternative frameworks do is
- Provide the developer with a button in the app to "clear the cache".
- Cache on function code. I.e. if you change the implementation the cache will be cleared.
Panel could maybe do some of the above. An alternative would be to document in a guide what to do in code. That is probably to run pn.state.clear_caches() or some_cached_func.clear().
Autoreload and caching are really powerful. But sometimes they don't work well together.
If you have cached a function but figure out its implementation should be changed its not clear how to handle this. So what I normally do is to restart the server. This is a slow process.
What alternative frameworks do is
Panel could maybe do some of the above. An alternative would be to document in a guide what to do in code. That is probably to run
pn.state.clear_caches()orsome_cached_func.clear().