/// <summary> /// Adds an operation that purges content for a HAProxy frontend from the cache. /// </summary> /// <param name="frontendUri"> /// The HAProxy frontend URI to be removed with optional <b>"*"</b> or <b>"**"</b> wildcards. /// </param> public void AddPurgeOrigin(string frontendUri) { Covenant.Requires <ArgumentNullException>(!string.IsNullOrEmpty(frontendUri)); if (!Uri.TryCreate(frontendUri, UriKind.Absolute, out var uri)) { throw new ArgumentException($"[{frontendUri}] is not a valid URI."); } var globPattern = uri.PathAndQuery; GlobPattern.Parse(globPattern); // This validates the pattern. PurgeOperations.Add(PurgeOperation.CreateOriginPurge(uri.Host, uri.Port, uri.PathAndQuery)); }
/// <summary> /// Adds an operation that purges all cached content. /// </summary> public void AddPurgeAll() { PurgeOperations.Add(PurgeOperation.CreatePurgeAll()); }