1. A method for evaluating a context-based policy, the policy having a set of attributes, the method comprising: identifying a relative frequency of a set of attribute values; sorting the set of attribute values; assigning an identifier to each of the sorted attribute values; using the identifiers assigned to the sorted attribute values, generating a search tree, each leaf of the search tree defining a rule, and wherein a depth-first path down the leaf represents one or more attributes of the set of attributes that must be present in a request for the rule to be applicable; and evaluating a request against the search tree to generate a response.