class Aws::S3::Plugins::S3Signer::CachedBucketRegionHandler

def check_for_cached_region(context, bucket)

def check_for_cached_region(context, bucket)
  cached_region = Aws::S3.bucket_region_cache[bucket]
  if cached_region &&
     cached_region != context.config.region &&
     !S3Signer.custom_endpoint?(context)
    context.http_request.endpoint.host = S3Signer.new_hostname(
      context, cached_region
    )
    context[:sigv4_region] = cached_region # Sign plugin will use this
  end
end