abhijeets25012-tech opened a new pull request, #61572:
URL: https://github.com/apache/airflow/pull/61572

   Description
   This PR improves performance of requires_access_dag by introducing caching
   for DAG team name lookup and authorization checks.
   
   Currently, DagModel.get_team_name and authorization logic may be executed
   multiple times for repeated requests. Using lru_cache reduces redundant
   calls and improves API performance, especially in high-traffic environments.
   
   What is included
   - Added get_team_name_cached using lru_cache
   - Added is_authorized_cached to avoid repeated authorization computation
   - Updated requires_access_dag to use cached helpers
   
   Why this change
   Frequent permission checks on DAG endpoints can trigger repeated database
   lookups. Caching reduces overhead and improves response latency without
   changing behavior.
   
   Testing
   - No functional logic changes
   - Existing tests should pass without modification
   
   Notes
   This change focuses only on performance optimization and keeps existing
   authorization behavior intact.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to