How to add support for caching plugins for my own plugin?

Is there a generic way to support caching plugins? For example to set a flag after you update an option that caching plugins watch?

No, there isn’t. On top of that, caching may not even occur in WordPress itself. E.g. Varnish, Cloudflare, etc

You will need to handle each plugin on a case by case basis.

The closest you might get, is that a caching plugin watches for post saves to update or invalidate cached results. But since you’re writing a shortcode, there is no mechanism for flushing the cache in a generic way, or indicating that a page should not be cached in WordPress. This is because WordPress does not perform page caching, so all page caching plugins have bespoke unique implementations.