Skip to content

IRedirectCache

Troy Willmot edited this page Sep 25, 2016 · 2 revisions

IRedirectCache

Summary

The IRedirectCache interface is used for components that cache a source URI to a final URI, regardless of how many redirects would normally occur if the source URI were requested. It is primarily used by the RedirectHandler.

A simple, in-memory, non-persistent implementation is provided by RedirectCache.

Implementations of this interface should be thread-safe.

Methods

AddOrUpdateRedirect

void AddOrUpdateRedirect(Uri originalUri, Uri redirectUri)

Adds a mapping from a URI to a redirected URI to the cache. The redirectUri should be the URI redirected to by originalUri.

Clear

void Clear()

Removes all entries from the cache.

GetFinalUri

Uri GetFinalUri(Uri originalUri)

Retrieves the final URI in a redirect chain for the URI specified by originalUri.

RemoveRedirect

void RemoveRedirect(Uri originalUri)

Removes the redirect for a specific URI from the cache.