Move cache update logic from signal to model save method and track original values to properly clear old cache when circuit_id or term_side changes. Add comprehensive tests for all cache update scenarios. Fixes #21686