Instead of using ToLower, use StartsWith ("cgi", StringComparison.OrginalIgnoreCase) - it's faster and doesn't allocate a new string