Skip to content

Enable me to reset the cache when using --autoreload #6650

Description

@MarcSkovMadsen

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementMinor feature or improvement to an existing feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions