C# Class EnterpriseWebLibrary.EnterpriseWebFramework.EwfSafeResponseWriter

An object that writes a response to a safe HTTP request (e.g. GET, HEAD).
Afficher le fichier Open project: enduracode/enterprise-web-library Class Usage Examples

Méthodes publiques

Méthode Description
EwfSafeResponseWriter ( EwfResponse response ) : System

Creates a response writer with a generic response and no caching information.

EwfSafeResponseWriter ( Func responseCreator, string urlVersionString, Func useMemoryCacheGetter ) : System

Creates a response writer with a BLOB-file response.

EwfSafeResponseWriter ( Func responseCreator, DateTimeOffset lastModificationDateAndTime, Func memoryCacheKeyGetter = null ) : System

Creates a response writer with a generic response, a last-modification date/time (which enables conditional requests), and an optional memory-cache key. Do not use this overload if the response will vary based on non-URL elements of the request, such as the authenticated user, since a parameter doesn't exist yet to incorporate those elements into the ETag.

EwfSafeResponseWriter ( Func responseCreator, string urlVersionString, Func memoryCachingSetupGetter = null ) : System

Creates a response writer with a generic response, a resource-version string from the request URL, and optional memory caching information. Including a version string in a resource's URL greatly improves the cacheability of the resource, so you should use this technique whenever you have the ability to change the URL when the resource changes. Do not use a version string if the response will vary based on non-URL elements of the request, such as the authenticated user.

EwfSafeResponseWriter ( Func cssGetter, string urlVersionString, Func memoryCachingSetupGetter ) : System

Creates a response writer with CSS text.

GetUrlVersionString ( DateTimeOffset dateAndTime ) : string

Returns the URL resource-version string for the specified date/time.

Private Methods

Méthode Description
WriteResponse ( ) : void
createWriter ( Func responseCreator, string urlVersionString, string eTagBase, Func lastModificationDateAndTimeGetter, Func memoryCacheKeyGetter ) : HttpResponse>.Action

Method Details

EwfSafeResponseWriter() public méthode

Creates a response writer with a generic response and no caching information.
public EwfSafeResponseWriter ( EwfResponse response ) : System
response EwfResponse The response.
Résultat System

EwfSafeResponseWriter() public méthode

Creates a response writer with a BLOB-file response.
public EwfSafeResponseWriter ( Func responseCreator, string urlVersionString, Func useMemoryCacheGetter ) : System
responseCreator Func The response creator.
urlVersionString string The resource-version string from the request URL. Including a version string in a resource's URL greatly improves the /// cacheability of the resource, so you should use this technique whenever you have the ability to change the URL when the resource changes. Do not use a /// version string if the response will vary based on non-URL elements of the request, such as the authenticated user. Do not pass null.
useMemoryCacheGetter Func A function that gets whether you want to use EWL's memory cache for this response. Do not pass null.
Résultat System

EwfSafeResponseWriter() public méthode

Creates a response writer with a generic response, a last-modification date/time (which enables conditional requests), and an optional memory-cache key. Do not use this overload if the response will vary based on non-URL elements of the request, such as the authenticated user, since a parameter doesn't exist yet to incorporate those elements into the ETag.
public EwfSafeResponseWriter ( Func responseCreator, DateTimeOffset lastModificationDateAndTime, Func memoryCacheKeyGetter = null ) : System
responseCreator Func The response creator.
lastModificationDateAndTime DateTimeOffset The last-modification date/time of the resource.
memoryCacheKeyGetter Func A function that gets the memory-cache key for this response. Pass null or return the empty string if you do not want /// to use EWL's memory cache. Do not return null.
Résultat System

EwfSafeResponseWriter() public méthode

Creates a response writer with a generic response, a resource-version string from the request URL, and optional memory caching information. Including a version string in a resource's URL greatly improves the cacheability of the resource, so you should use this technique whenever you have the ability to change the URL when the resource changes. Do not use a version string if the response will vary based on non-URL elements of the request, such as the authenticated user.
public EwfSafeResponseWriter ( Func responseCreator, string urlVersionString, Func memoryCachingSetupGetter = null ) : System
responseCreator Func The response creator.
urlVersionString string The resource-version string from the request URL. Do not pass null or the empty string.
memoryCachingSetupGetter Func A function that gets the memory-caching setup object for the response. Pass null or return null if you do not /// want to use EWL's memory cache.
Résultat System

EwfSafeResponseWriter() public méthode

Creates a response writer with CSS text.
public EwfSafeResponseWriter ( Func cssGetter, string urlVersionString, Func memoryCachingSetupGetter ) : System
cssGetter Func A function that gets the CSS that will be preprocessed and used as the response. Do not pass or return null.
urlVersionString string The resource-version string from the request URL. Do not pass null or the empty string; this parameter is required /// because it greatly improves cacheability, which is important for CSS. You must change the URL when the CSS changes, and you must not vary the response /// based on non-URL elements of the request, such as the authenticated user.
memoryCachingSetupGetter Func A function that gets the memory-caching setup object for the response. Do not pass or return null; memory caching /// is important for CSS and is therefore required.
Résultat System

GetUrlVersionString() public static méthode

Returns the URL resource-version string for the specified date/time.
public static GetUrlVersionString ( DateTimeOffset dateAndTime ) : string
dateAndTime DateTimeOffset
Résultat string