# Production Performance Optimizations
when@prod:
    framework:
        # Disable debug mode
        secret: '%env(APP_SECRET)%'
        
        # Session optimization
        # SameSite=Lax: Session-Cookie wird bei Top-Level-GET-Redirects (z. B. OAuth-Callback von anderem Server) mitgeschickt.
        # Strict bricht Cross-Domain-OAuth-Flows ab, weil der Browser das Cookie bei der Rückkehr nicht sendet.
        session:
            handler_id: null
            cookie_secure: true
            cookie_samesite: lax
            gc_probability: 1
            gc_divisor: 1000
            gc_maxlifetime: 1440
        
        # HTTP cache
        http_cache:
            enabled: true
            debug: false
        
        # Asset optimization
        assets:
            json_manifest_path: '%kernel.project_dir%/public/build/manifest.json'
        
        # Cache optimization
        cache:
            pools:
                # High-performance cache pools
                cache.performance:
                    adapter: cache.adapter.redis
                    default_lifetime: 7200
                
                # Session cache
                cache.session:
                    adapter: cache.adapter.redis
                    default_lifetime: 3600

    # Doctrine optimizations
    doctrine:
        dbal:
            # Connection optimization
            connections:
                default:
                    server_version: '16'
                    charset: utf8mb4
                    default_table_options:
                        charset: utf8mb4
                        collate: utf8mb4_unicode_ci

    # Twig optimizations
    twig:
        cache: '%kernel.cache_dir%/twig'
        auto_reload: false
        strict_variables: false
        debug: false
        
    # Monolog optimization - removed to avoid conflicts with main monolog.yaml
